<?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 Jessica Ross How I became a Cloud DevOps Engineer! on Medium]]></title>
        <description><![CDATA[Stories by Jessica Ross How I became a Cloud DevOps Engineer! on Medium]]></description>
        <link>https://medium.com/@mrskeetonthe1?source=rss-694a3fb4bf91------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*E1aa8erdgIR--CPiL78_sg.jpeg</url>
            <title>Stories by Jessica Ross How I became a Cloud DevOps Engineer! on Medium</title>
            <link>https://medium.com/@mrskeetonthe1?source=rss-694a3fb4bf91------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 09:04:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mrskeetonthe1/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[Enhancing Customer Experience with AI-Powered Image Recognition and Sentiment Analysis]]></title>
            <link>https://medium.com/@mrskeetonthe1/enhancing-customer-experience-with-ai-powered-image-recognition-and-sentiment-analysis-f72de94b2a96?source=rss-694a3fb4bf91------2</link>
            <guid isPermaLink="false">https://medium.com/p/f72de94b2a96</guid>
            <category><![CDATA[sentiment-analysis]]></category>
            <category><![CDATA[image-recognition]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Jessica Ross How I became a Cloud DevOps Engineer!]]></dc:creator>
            <pubDate>Sun, 03 Nov 2024 03:05:15 GMT</pubDate>
            <atom:updated>2024-11-03T03:05:15.013Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YLk5Lp4lXvHCZlZDppRkgg.jpeg" /></figure><p>In today’s fast-paced digital marketplace, understanding customer feedback is vital for any business looking to thrive. Level Up Llama Tech, a tech accessories company, is on a mission to enhance customer satisfaction by efficiently managing customer feedback and product reviews. This post outlines a robust solution using Azure AI services to automate the analysis of customer reviews and product images, ultimately providing actionable insights to improve product offerings.</p><h4>Step-by-Step Implementation</h4><h4>Foundational Solution</h4><h4>Step 1: Set Up Azure Cognitive Services</h4><ol><li><strong>Create a Resource Group</strong>:</li></ol><ul><li>Go to the Azure Portal.</li><li>Click on “Resource groups” &gt; “Add” to create a new resource group for your project.</li></ul><pre>az group create --name LlamaTechRG --location eastus</pre><p><strong>2. Create a Computer Vision Resource</strong>:</p><ul><li>In the Azure Portal, search for “Cognitive Services” and select “Create”.</li><li>Fill in the details and select “Computer Vision” as the resource type.</li></ul><p><strong>3. Create a Text Analytics Resource</strong>:</p><ul><li>Repeat the process to create a second Cognitive Services resource, this time selecting “Text Analytics”.</li></ul><h4>Step 2: Store a Dataset of Customer Images and Reviews</h4><ol><li><strong>Create a Storage Account</strong>:</li></ol><ul><li>In the Azure Portal, search for “Storage accounts” and create a new storage account.</li></ul><p><strong>2. Create a Blob Container</strong>:</p><ul><li>Navigate to your storage account and create a new Blob container to hold your images and reviews.</li></ul><p><strong>3. Upload Sample Images and Reviews</strong>:</p><ul><li>Upload a dataset of customer images and review text files to the Blob container.</li></ul><h4>Step 3: Analyze Images with Computer Vision</h4><ol><li><strong>Use the Analyze Image API</strong>:</li></ol><ul><li>In the Azure Portal, navigate to your Computer Vision resource.</li><li>Use the “Analyze Image” feature to test image recognition on your uploaded images.</li></ul><h4>Step 4: Analyze Reviews with Text Analytics</h4><ol><li><strong>Use the Sentiment Analysis API</strong>:</li></ol><ul><li>In your Text Analytics resource, utilize the “Sentiment Analysis” API to analyze the uploaded reviews.</li><li>Review the sentiment scores generated by the API to understand customer satisfaction levels.</li></ul><h4>Step 5: Summarize the Findings</h4><ol><li><strong>Review and Document Analysis Results</strong>:</li></ol><ul><li>Compile the insights gathered from both the image recognition and sentiment analysis.</li><li>Create a report detailing the findings and suggested actions based on customer feedback.</li></ul><h4>Advanced Solution</h4><p>To take the solution a step further, we can automate the processing of images and reviews using Azure Functions.</p><h4>Step 6: Set Up Azure Functions</h4><ol><li><strong>Create a Function App</strong>:</li></ol><ul><li>In the Azure Portal, search for “Function Apps” and create a new function app.</li><li>Choose a runtime stack (e.g., Node.js or Python).</li></ul><h4>Step 7: Create a Function to Trigger on Blob Uploads</h4><ol><li><strong>Create a Function</strong>:</li></ol><ul><li>In your Function App, create a new function that triggers when new blobs are uploaded to your Blob storage.</li><li>Use the Azure Blob Storage trigger template to get started.</li></ul><h4>Step 8: Automate Image and Review Processing</h4><ol><li><strong>Configure the Function</strong>:</li></ol><ul><li>Inside the function code, implement logic to call the Computer Vision and Text Analytics APIs whenever a new image or review is uploaded.</li><li>Handle the responses and store the analysis results back into Blob storage.</li></ul><h4>Step 9: Monitor and Manage</h4><ol><li><strong>Use Azure Monitor</strong>:</li></ol><ul><li>Set up Azure Monitor to track the performance of your Azure Functions.</li><li>Create alerts for any failures or performance issues to ensure smooth operation.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f72de94b2a96" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure Remote Administration and Troubleshooting of Azure VMs with Auto Scaling and Load Balancing]]></title>
            <link>https://medium.com/@mrskeetonthe1/secure-remote-administration-and-troubleshooting-of-azure-vms-with-auto-scaling-and-load-balancing-8056fd1e6f59?source=rss-694a3fb4bf91------2</link>
            <guid isPermaLink="false">https://medium.com/p/8056fd1e6f59</guid>
            <category><![CDATA[azure-vm]]></category>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[azure-virtual-machines]]></category>
            <category><![CDATA[autoscaling]]></category>
            <dc:creator><![CDATA[Jessica Ross How I became a Cloud DevOps Engineer!]]></dc:creator>
            <pubDate>Sun, 03 Nov 2024 02:32:59 GMT</pubDate>
            <atom:updated>2024-11-03T02:32:59.616Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6aD5d_xO_93Nam3wUQyeyQ.jpeg" /></figure><p>In an era where businesses rely on robust and scalable cloud infrastructure, Level Up Corporation faces the challenge of efficiently managing over 100 Azure Virtual Machines (VMs). With a globally dispersed IT team, the need for secure remote administration and troubleshooting tools is paramount to minimize downtime and security risks. This guide will walk you through the steps to implement a solution that includes Auto Scaling, Load Balancing, and secure remote access for both Linux and Windows VMs.</p><h4>Overview of the Proposed Solution</h4><p>To meet the demands of scalability, availability, and security, we will set up:</p><ul><li><strong>Auto Scaling Groups</strong> to adjust the number of VMs based on demand.</li><li><strong>Load Balancers</strong> to evenly distribute traffic across the VMs.</li><li><strong>Secure Remote Access</strong> using SSH for Linux VMs and RDP for Windows VMs, facilitated by Azure Bastion.</li><li>A <strong>comprehensive virtual network</strong> setup to ensure secure communication.</li></ul><h4>Step 1: Deploy a Linux Azure VM</h4><p>Let’s start by deploying a Linux Azure VM.</p><h4>1.1 Create a Resource Group</h4><pre>az group create --name LevelUpResourceGroup --location eastus</pre><h4>1.2 Create a Virtual Network and Subnet</h4><pre>az network vnet create --resource-group LevelUpResourceGroup --name LevelUpVNet --subnet-name LevelUpSubnet</pre><h4>1.3 Create a Network Security Group (NSG)</h4><pre>az network nsg create --resource-group LevelUpResourceGroup --name LevelUpNSG</pre><h4>1.4 Allow SSH Access in NSG</h4><pre>az network nsg rule create --resource-group LevelUpResourceGroup --nsg-name LevelUpNSG --name AllowSSH --protocol tcp --priority 1000 --destination-port-range 22 --access Allow --direction Inbound</pre><h4>1.5 Deploy the Linux VM</h4><pre>az vm create \<br>  --resource-group LevelUpResourceGroup \<br>  --name LevelUpLinuxVM \<br>  --image UbuntuLTS \<br>  --admin-username azureuser \<br>  --ssh-key-value ~/.ssh/id_rsa.pub \<br>  --nsg LevelUpNSG \<br>  --vnet-name LevelUpVNet \<br>  --subnet LevelUpSubnet</pre><h4>1.6 SSH into the Deployed Linux VM</h4><p>Once the VM is running, SSH into it to verify access.</p><pre>ssh azureuser@&lt;Public_IP_of_VM&gt;<br>whoami</pre><h4>Step 2: Set Up Auto Scaling for the VMs</h4><h4>2.1 Create an Auto Scale Configuration</h4><p>To set up auto-scaling, you’ll need to create a scale set.</p><pre>az vmss create \<br>  --resource-group LevelUpResourceGroup \<br>  --name LevelUpVMSS \<br>  --image UbuntuLTS \<br>  --upgrade-policy-mode automatic \<br>  --admin-username azureuser \<br>  --ssh-key-value ~/.ssh/id_rsa.pub \<br>  --instance-count 2 \<br>  --vnet-name LevelUpVNet \<br>  --subnet LevelUpSubnet \<br>  --nsg LevelUpNSG</pre><h4>2.2 Configure Scaling Rules</h4><pre>az monitor autoscale create \<br>  --resource-group LevelUpResourceGroup \<br>  --resource-name LevelUpVMSS \<br>  --resource-type Microsoft.Compute/virtualMachineScaleSets \<br>  --name LevelUpAutoscale \<br>  --min-count 2 --max-count 10 --count 2<br><br>az monitor autoscale rule create \<br>  --resource-group LevelUpResourceGroup \<br>  --autoscale-name LevelUpAutoscale \<br>  --scale out 1 --condition &quot;Percentage CPU &gt; 75 avg 5m&quot;</pre><h4>Step 3: Deploy a Windows Azure VM</h4><p>Next, let’s deploy a Windows VM.</p><h4>3.1 Create a Windows VM</h4><pre>az vm create \<br>  --resource-group LevelUpResourceGroup \<br>  --name LevelUpWindowsVM \<br>  --image win2019datacenter \<br>  --admin-username azureuser \<br>  --admin-password YourPassword123! \<br>  --nsg LevelUpNSG \<br>  --vnet-name LevelUpVNet \<br>  --subnet LevelUpSubnet</pre><h4>3.2 Allow RDP Access in NSG</h4><pre>az network nsg rule create --resource-group LevelUpResourceGroup --nsg-name LevelUpNSG --name AllowRDP --protocol tcp --priority 1001 --destination-port-range 3389 --access Allow --direction Inbound</pre><h4>3.3 RDP into the Deployed Windows VM</h4><ol><li>Get the public IP of the Windows VM:</li></ol><pre>az vm show --resource-group LevelUpResourceGroup --name LevelUpWindowsVM --query publicIpAddress -o tsv</pre><p>2. Use Remote Desktop Connection to connect to the VM.</p><h4>Step 4: Configure Load Balancer</h4><p>To ensure high availability, we will configure a Load Balancer.</p><h4>4.1 Create the Load Balancer</h4><pre>az network lb create \<br>  --resource-group LevelUpResourceGroup \<br>  --name LevelUpLoadBalancer \<br>  --sku Standard \<br>  --frontend-ip-name FrontendPool \<br>  --backend-pool-name BackendPool</pre><h4>4.2 Create Load Balancer Rules</h4><pre>az network lb rule create \<br>  --resource-group LevelUpResourceGroup \<br>  --lb-name LevelUpLoadBalancer \<br>  --name HTTPRule \<br>  --protocol tcp \<br>  --frontend-port 80 \<br>  --backend-port 80 \<br>  --frontend-ip-config FrontendPool \<br>  --backend-pool BackendPool</pre><h4>4.3 Register VM Instances with Load Balancer</h4><pre>az network nic ip-config update \<br>  --resource-group LevelUpResourceGroup \<br>  --lb-name LevelUpLoadBalancer \<br>  --nic LevelUpLinuxVM \<br>  --ip-config-name ipconfig1 \<br>  --backend-pool LevelUpLoadBalancerBackendPool</pre><h4>Step 5: Configure Azure Bastion (Optional)</h4><p>To further enhance security, consider deploying Azure Bastion for secure management.</p><h4>5.1 Create Azure Bastion</h4><pre>az network bastion create \<br>  --name LevelUpBastion \<br>  --resource-group LevelUpResourceGroup \<br>  --location eastus \<br>  --vnet-levelupvnet \<br>  --public-ip-address LevelUpBastionIP</pre><h4>5.2 Connect to VMs Using Azure Bastion</h4><ol><li>Go to the Azure Portal.</li></ol><p>2. Navigate to your Bastion resource.</p><p>3. Select the VM you want to connect to and click on “Connect.”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8056fd1e6f59" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Serverless Website Deployment via CI/CD Pipeline]]></title>
            <link>https://medium.com/@mrskeetonthe1/automating-serverless-website-deployment-via-ci-cd-pipeline-f1b442dc8ad5?source=rss-694a3fb4bf91------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1b442dc8ad5</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Jessica Ross How I became a Cloud DevOps Engineer!]]></dc:creator>
            <pubDate>Sun, 03 Nov 2024 01:34:54 GMT</pubDate>
            <atom:updated>2024-11-03T01:34:54.557Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Step-by-Step Guide to Deploying a Serverless Website with Code Pipeline and AWS Lambda</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*naoPK3bALaWF-BJY.png" /></figure><h4>Scenario:</h4><p>Vitality Sphere is a health and wellness company dedicated to improving its clients’ well-being through various services and products. The company’s online presence has grown significantly, with a website hosted on an AWS EC2 instance. As the company expands, it seeks to modernize its infrastructure to improve performance, reduce costs, and gain better insights into user interactions.</p><h4>Project Overview:</h4><p>The cloud engineers for Vitality Sphere are tasked with implementing a series of updates and improvements to the company’s website and deployment processes. These updates will ensure that Vitality Sphere maintains a high level of service and stays competitive in the market. The company wants to migrate its website to a more cost-effective and scalable solution, implement user interaction tracking, and streamline its deployment process.</p><blockquote><em>Let’s get started!!!</em></blockquote><h4>Task 1: Migrate the Website to a Static S3 Hosted Website</h4><p><strong>Objectives:</strong></p><ul><li><strong>Migrate Content:</strong> Move the website content (HTML, CSS, JavaScript, images) from the current EC2 instance to an S3 bucket configured for static website hosting.</li><li><strong>Set Up CloudFront:</strong> Configure CloudFront to serve the static website, ensuring reduced latency and improved load times for users worldwide.</li><li><strong>Update DNS:</strong> Use Route 53 to point the company’s domain to the CloudFront distribution.</li></ul><h4>Migrating Content:</h4><blockquote><strong><em>contributor | </em></strong><a href="https://medium.com/@mrskeetonthe1"><strong><em>Jessica Ross</em></strong></a></blockquote><p>Content migrating is the process of transferring files from one AWS service to another. In this scenario, Vitality Sphere, a health and wellness company, hosted a website on AWS EC2 but as the company’s online presence grew, so did the need to upgrade to a more secure, modernized infrastructure to improve performance, reduce costs, and gain better insights into user interactions.</p><p>AWS S3 is a way to store files in a more secure fashion that allows you to host a static website, and layer other services to implement scalability, reliability, performance, and track metrics on user insights.</p><p><strong>Objective:</strong> Move files from AWS EC2 to a S3 bucket.</p><p><strong>Migration Steps:</strong></p><ol><li>Connect to the EC2 instance via Sessions Manager.</li><li>Update the AWS packages so the terminal can communicate using AWS commands.</li></ol><pre>Sudo apt-get install s3cmd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*IhX64VES4xzXTPuz" /><figcaption>Sudo apt-get install s3cmd</figcaption></figure><p>3. Locate the files within the instance.</p><pre>ls</pre><p>4. Know the path to get to the files.</p><pre>/var/www/html</pre><p>With the files located, migrating the files can happen in one of two ways:</p><ol><li>One at a time, which can be time-consuming depending on how many files you have.</li><li>Moving whole directories.</li></ol><p>I started by moving each file individually using the following command:</p><pre>Sudo aws s3 cp /var/www/html/about.html s3://pod1.dev.vitality.luitprojects.com/about.html</pre><p>This code allows elevated privileges to the user (sudo) on AWS S3 to copy (cp) from the location of the files in the EC2 instance (/var/www/html) file named (about.html) to the S3 bucket (s3://pod1.dev.vitality.luitprojects.com) with the file name at the end (about.html).</p><p>I quickly realized there was a faster way of moving files, by moving whole directories with the following command:</p><pre>Sudo  aws s3 cp /var/www/html/ s3://pod1.dev.vitality.luitprojects.com/ – -recursive</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*lgogOyv6SlwZYMIV" /><figcaption>Output</figcaption></figure><p>I repeated the process of copying the same files into the 2nd s3 bucket named:</p><ul><li>pod1.vitality.luitprojects.com</li></ul><h4>Hosting the Static Website on S3:</h4><blockquote><strong><em>contributors | </em></strong><a href="https://medium.com/@hadianoor16"><strong><em>Hadia Noor</em></strong></a><strong><em> &amp; </em></strong><a href="https://medium.com/@mrskeetonthe1"><strong><em>Jessica Ross</em></strong></a></blockquote><p>A static website is a basic type of website that contains web pages with fixed content.</p><p><strong>Objective:</strong> Create a static website</p><p><strong>Steps:</strong></p><ol><li>Locate the S3 bucket that has the objects you added to it.</li></ol><ul><li>pod1.dev.vitality.luitprojects.com</li><li>pod1.vitality.luitprojects.com</li></ul><p>2. Click on the highlighted bucket and the properties tab. Scroll to the bottom of the page and edit Static Web Hosting.</p><p>3. Toggle ‘Enable static web hosting and host a static website’. Enter index.html under index document and save changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*rp4mgv6E1daHFSi0" /><figcaption>Static Website Hosting</figcaption></figure><p>Repeat the process for the second bucket. There should be two static websites hosted, one for each bucket. The bucket policies will be different to reflect what is allowed and how each bucket interacts with users. Be mindful of who and what you allow in each bucket. That is very important to keep the buckets safe and secure.</p><h4>Hosted Zones:</h4><p>AWS Route 53 hosted zones are like a well-organized container for DNS records, and they play a crucial role in managing how traffic flows for a specific domain.</p><p><strong>Objective:</strong> Create a hosted zone for pod1.dev.vitality.luitprojects.com</p><ol><li>Search Route 53 in AWS and select Hosted Zones from the dashboard. Click<strong> Create record</strong>.</li></ol><ul><li>Give it a domain name</li><li>Set the type to <strong>Public hosted zone</strong></li><li>Click <strong>Create hosted zone</strong></li></ul><p>2. Once the hosted zone is created, edit the record.</p><ul><li>Leave the record name as default</li><li>Record type will be ‘A-Routes traffic to a IPv4 address and some AWS resources</li><li>Toggle Alias</li><li>Route traffic to ‘Alias to S3 website endpoint</li><li>Locate the region the S3 was created in</li><li>Enter S3 endpoint (name of the record)</li><li>Simple routing policy</li><li>Toggle evaluate health targets to ‘yes’</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*N__5XV_7Ldmn0gtc" /><figcaption>Route 53 Hosted Zone Setup</figcaption></figure><h4>Deploy Amazon CloudFront Distribution for Production Website:</h4><blockquote><strong><em>contributor | </em></strong><a href="https://medium.com/@hadianoor16"><strong><em>Hadia Noor</em></strong></a></blockquote><p>Amazon CloudFront is a web service that speeds up the distribution of your static and dynamic web content, such as .html, .css, .js, and image files, to your users. CloudFront delivers your content through a worldwide network of data centers called edge locations. When a user requests content that you’re serving with CloudFront, 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>In this task, we will integrate the S3 bucket to CloudFront to achieve seamless performance for our website content delivery.</p><h4>Steps:</h4><ol><li>Go to CloudFront and click Create Distribution. Choose prod S3 bucket as Origin domain from dropdown.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*ZUDxB6ZyaEewdOGi" /><figcaption>Create distribution</figcaption></figure><p>2. For Origin access, choose Origin Access Control setting (OAC) instead of Public. It makes sure that your bucket is not accessible publicly by everyone and is only accessible via CloudFront. (Create new OAC, leave the defaults, and click Create).</p><blockquote><em>Notice that you must update your bucket policy at the end that CloudFront provides you.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*ks68y9mesYkjnKes" /><figcaption>Origin access control settings</figcaption></figure><p>3. For Default cache behavior choose Redirect HTTP to HTTPs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/0*Db-0pl5F-oANwkgl" /><figcaption>Default cache behavior settings</figcaption></figure><p>4. Keep Cache key and origin requests as Recommended settings.</p><p><strong>Note:</strong> You can also change the policy to ‘Caching Disabled’ if you are testing some changes on the webpage to see if CloudFront is serving the right content as Cache invalidations will cost you some money and you don’t want to wait for TTL to expire. This setting can also be changed later once the distribution is created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/0*Z2QgAfIdG992MrRS" /><figcaption>Caching Optimized</figcaption></figure><p>5. Scroll down to Web Application Firewall (WAF). Keep the WAF to “Do not enable security protections” for now.</p><p>6. Scroll down to Settings, and choose “Use all edge locations (best performance)”.</p><ul><li>Click ‘Add item’ copy your registered domain name in this field and choose the custom SSL certificate you requested from AWS. Please refer to this document to request an SSL certificate for your domain.</li></ul><p><a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html">https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*KF8EoeODnNAG39aQ" /></figure><p><strong><em>Why alternate domain name:</em></strong></p><p>When you create a distribution, CloudFront provides a domain name for it, such as d111111abcdef8.cloudfront.net. Instead of using this provided domain name, you can use an alternate domain name (also known as a CNAME).</p><p><strong><em>Why we need an SSL certificate:</em></strong></p><p>To add an alternate domain name (CNAME) to a CloudFront distribution, you must attach to your distribution a trusted, valid SSL/TLS certificate that covers the alternate domain name. This ensures that only people with access to your domain’s certificate can associate with CloudFront a CNAME related to your domain.</p><p>You can add other domain names as well but that should be covered by your SSL certificate. For example, the certificate requested as *.example.com can cover domains like marketing.example.com, web.example.com, support.example.com, etc. However, you can’t add alternate domain names that are at levels higher or lower than the wildcard. For example, you can’t add the alternate domain names example.com or marketing.product.example.com.</p><p>This is detailed documentation from AWS about using alternate domain names:</p><p><a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html">https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html</a></p><p>7. Use index.html for ‘Default root object’. This ensures that index.html is returned by default when the user requests the root URL (/) instead of a specific object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/0*Nk52hELwfjUwlL3L" /></figure><p>Click ‘Create distribution’. It will take some time as CloudFront is Deploying. When it’s ready, copy the distribution domain name and you will see your webpage is now being served by CloudFront.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*2cdXMHQu0CFs9-Km" /><figcaption>Website served by CloudFront</figcaption></figure><p>Also, notice that the webpage loaded faster compared to when it was served from the former EC2 instance or S3 bucket. CloudFront speeds up content delivery by leveraging its global network of data centers, known as edge locations, to reduce delivery time by caching your content close to your end users.</p><h4>DNS Configuration:</h4><blockquote><strong><em>contributor | </em></strong><a href="https://medium.com/@labossiere01"><strong><em>John Labossiere</em></strong></a></blockquote><p>A <strong>DNS (Domain Name System)</strong> record is critical for mapping URLs to IP addresses and directing internet traffic to the correct endpoints. An <strong>A Record (Address Record)</strong> maps a domain name to an IPv4 address.</p><p><strong>Amazon Route 53</strong> is a DNS web service by AWS that helps route user requests to applications hosted on AWS or elsewhere. It offers domain registration, DNS routing, and ensures traffic to endpoints. With multiple routing options and smooth integration with AWS services like CloudFront and S3, Route 53 makes managing web applications easier.</p><p><strong>Objective:</strong></p><ol><li>Direct the production domain to the CloudFront distribution, ensuring the S3 bucket is accessible only through CloudFront as per security requirements.</li><li>Modify the Route 53 DNS record to direct the development domain to the dev static S3 website.</li></ol><p><strong>Update Production DNS Record to Point to CloudFront Implementation steps:</strong></p><ol><li>Navigate to Route 53 management console.</li><li>Click on ‘Hosted zones’.</li><li>Click on ‘<strong>pod1.vitality.luitprojects.com</strong>’<strong>.</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*b6WDTRoWp2VFHGIG" /></figure><p>4. Create a new record.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*jssczPVGxOCh85jf" /><figcaption>New record creation</figcaption></figure><p>5. Select ‘<strong>A record</strong>’ for Record Type.</p><p>6. Ensure the ‘<strong>Alias</strong>’ option is set to ‘<strong>Yes</strong>’.</p><p>7. For ‘Route traffic’ select ‘<strong>Alias to CloudFront distribution</strong>’.</p><p>8. Choose the CloudFront distribution domain ‘<strong>d34e450snuwv6b.cloudfront.net</strong>’.</p><p>9. Save the new DNS record.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*u-jcl05IV46uk7Y5" /><figcaption>New record creation</figcaption></figure><p>10. Test the setup by searching the URL and using the ‘<strong>nslookup</strong>’ command to verify the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/0*Pq1EIX8NzGjAov8j" /><figcaption>Test URL with ‘nslookup’ command</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*cw4IjmE6nDLGpGhj" /><figcaption>Website URL displaying correctly</figcaption></figure><p><strong>Update Development DNS Record Implementation steps:</strong></p><ol><li>Select the existing <strong>A record</strong> for ‘<strong>pod1.dev.vitality.luitprojects.com</strong>’ in the Route 53 management console</li></ol><p>2. Confirm that it is an <strong>A record</strong> and points to the S3 website endpoint ‘<strong>s3-website-us-east-1.amazonaws.com</strong>’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Jt6kAEgUHKc70pzW" /><figcaption>Confirm A record endpoint</figcaption></figure><p>3. Since the Dev DNS record of ‘<strong>pod1.dev.vitality.luitprojects.com</strong>’ is already correctly set up and pointing to the S3 website endpoint, there is no need for further action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*eg5VQG9kRPKxzaTK" /><figcaption>DNS Record</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*_BQHnC2xbJuinAKH" /><figcaption>DNS Record settings</figcaption></figure><p>4. Verify the configuration by searching the URL and running the ‘<strong>nslookup’</strong> command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/0*wbnWGnCAQsK6wJlA" /><figcaption>nslookup output</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Wi_qiC8TgLsuTsL4" /><figcaption>Website displaying correctly</figcaption></figure><h4>Task 2: Create an API for User Interaction Tracking</h4><blockquote><strong><em>contributors | </em></strong><a href="https://medium.com/@naperry2011"><strong><em>Nicholas Perry</em></strong></a><strong><em> &amp; </em></strong><a href="https://medium.com/@aparker735"><strong><em>Aynda Parker</em></strong></a><strong><em> &amp; </em></strong><a href="https://medium.com/@markeeta.d.little"><strong><em>Dionne Little</em></strong></a></blockquote><p><strong>Objectives:</strong></p><ul><li><strong>Set Up DynamoDB for Efficient Data Storage:</strong><br>Dependency: None, but needs to be set up before Lambda functions utilize it.</li><li><strong>API Development:</strong> Develop an API that triggers a Lambda function to record the time a user visits a page.</li><li><strong>Data Storage:</strong> Store the recorded data (timestamp and page URL) in a DynamoDB table.</li></ul><p><strong>Amazon DynamoDB</strong> is a fully managed NoSQL database service provided by AWS. It offers fast and predictable performance with seamless scalability. DynamoDB is designed to handle high throughput of read and write operations and can scale horizontally by adding more partitions. It supports both document and key-value store models and is optimized for low latency and high performance.</p><h4>Establish a DynamoDB Table</h4><p><strong>Steps:</strong></p><ol><li><strong>Open the DynamoDB Console</strong>:</li></ol><ul><li>Go to the<a href="https://aws.amazon.com/console/"> AWS Management Console</a>.</li><li>Navigate to the DynamoDB service.</li></ul><p><strong>Create a New Table</strong>:</p><ul><li>Click on “Create table”.</li><li><strong>Table name</strong>: TeamBlue_DynamoDB</li><li><strong>Partition key</strong>: Timestamp (String)</li><li><strong>Sort key</strong>: Page (String)</li></ul><p><strong>Set Table Settings</strong>:</p><ul><li>For this example, you can use the default settings. Optionally, adjust the read and write capacity modes based on your expected load (e.g., use on-demand capacity mode for automatic scaling).</li></ul><p><strong>Create the Table</strong>:</p><ul><li>Click on “Create” to establish the table.</li></ul><h4>Creation of Lambda Function and Setup of API Gateway:</h4><p>Lambda functions, part of AWS Lambda service, offer several benefits that make them highly advantageous for building serverless applications and executing backend tasks efficiently:</p><ul><li>No Server Management</li><li>Automatic Scaling</li><li>Flexibility in Programming Languages</li><li>Event-Driven Model and so much more</li></ul><h4>Lambda Function Creation Steps:</h4><ol><li><strong>Click on “Create function”</strong>:</li></ol><ul><li>On the Lambda dashboard, click on the orange “Create function” button.</li></ul><p>2.<strong> Select “Author from scratch” to create a new function.</strong></p><p>3. <strong>Basic Information</strong>:</p><ul><li><strong>Function Name</strong>: (team_blue)</li><li><strong>Runtime</strong>: Choose the runtime environment (Python 3.11)</li><li><strong>Role</strong>: This was given (LambdaToDynamoDB)</li></ul><p>4. <strong>Configure Triggers</strong></p><ul><li>Add Trigger (API Gateway)</li><li>Configure Trigger (POST Method)</li></ul><p>We have to add our script under the code section. This code was given and we had to tweak the code just a bit.</p><p>An example of our code is shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*PyknsT8sXvd6RLqG" /><figcaption>Code</figcaption></figure><blockquote><strong><em>Our code was tested and deployed for future usage.</em></strong></blockquote><h4>Create a New API:</h4><p>Creating an API Gateway for Vitality Sphere serves to enhance scalability by efficiently handling increased web traffic and dynamic scaling, reducing costs through a serverless architecture with pay-per-use pricing, and improving performance using caching and edge-optimized endpoints. It also facilitates user interaction tracking for better insights and real-time analytics, streamlines deployment with versioning, staging, and CI/CD integration, and ensures robust security with access control and protection against web threats. These improvements will make Vitality Sphere’s infrastructure more scalable, cost-effective, and performant, providing better user insights and a streamlined deployment process.</p><p><strong>Steps:</strong></p><ol><li>Click on <strong>Create API</strong>.</li><li>Choose the type of API you want to create. You can select between:</li></ol><ul><li><strong>HTTP API</strong>: For creating HTTP-based APIs.</li><li>Click <strong>Build</strong> under the chosen API type.</li></ul><h4>Configure API Settings:</h4><ol><li><strong>API Name</strong>: Enter a name for your API our name is TeamBlue_API.</li><li><strong>Description</strong>: (Optional) Enter a description for your API.</li></ol><h4>Create Resources and Methods:</h4><ol><li>In the API Gateway console, select your API from the list. TeamBlue_API.</li><li>Under the <strong>Resources</strong> section, click <strong>Create Resource</strong>.</li><li>Enter a resource name and path, then click <strong>Create Resource</strong>.</li><li>To create a method, select the newly created resource.</li><li>Click on <strong>Actions</strong> and select <strong>Create Method</strong>.</li><li>Choose an HTTP method ( POST) and click the checkmark.</li><li>Configure the method settings, such as integration type (Lambda Function, HTTP) and the corresponding configurations.</li></ol><h4>Deploy the API:</h4><ol><li>After creating the resources and methods, click on <strong>Actions</strong> and select <strong>Deploy API</strong>.</li><li>Create a new stage TeamBlue_API.</li><li>Enter a stage name and click <strong>Deploy</strong>.</li></ol><h4>Test the API:</h4><ol><li>Once deployed, go to the <strong>Stages</strong> section and select your stage. TeamBlue_API.</li><li>You will see the Invoke URL for your API. Use this URL to test your API using Postman.</li></ol><h4>Additional Configuration:</h4><ul><li><strong>Enable CORS</strong>: If you need to enable Cross-Origin Resource Sharing (CORS), go to the method settings, click on <strong>Enable CORS</strong>, and follow the prompts.</li><li><strong>Custom Domain Names</strong>: Set up a custom domain name for your API if needed.</li><li><strong>API Keys and Usage Plans</strong>: Configure API keys and usage plans for better management and security.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*Rt3OomqJNHW7sg5s" /><figcaption>CORS configuration</figcaption></figure><h4>Integrate Website with API Gateway Description:</h4><p>Update the static website code to include interaction with the newly configured API Gateway. This involves adding or modifying JavaScript in script.js to send data to the backend via API calls.</p><p>We need to update the website by going to CodeCommit, add the API URL to the script.js file and commit that file to update.</p><p>Grab the API URL from the API Gate→Team_BlueAPI→Stages: <a href="https://2djcuxzy4g.execute-api.us-east-1.amazonaws.com/metrics">https://2djcuxzy4g.execute-api.us-east-1.amazonaws.com/metrics</a></p><p>Once you have the URL got to code commit and follow the following steps<br><strong>Steps</strong></p><h4>Navigate to AWS CodeCommit:</h4><ol><li>Sign in to the AWS Management Console.</li><li>Open the <strong>CodeCommit</strong> console at<a href="https://console.aws.amazon.com/codecommit"> https://console.aws.amazon.com/codecommit</a>.</li></ol><h4>Open Your Repository:</h4><ol><li>In the navigation pane, choose <strong>Repositories</strong>.</li><li>Select the repository you want to update.</li></ol><h4>Navigate to the script.js File:</h4><ol><li>In the repository, navigate through the directory structure to find the script.js file.</li><li>Click on script.js to open it.</li><li>Edit the script.js File</li></ol><h4>Commit the Changes:</h4><ol><li>After making your changes, scroll down to the <strong>Commit message</strong> section.</li><li>Enter a commit message that describes the changes you made, for example, “Updated script.js to include API Gateway interaction”.</li><li>Click the <strong>Commit changes</strong> button.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/0*5XUf_IhJLe21onaj" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*JneTktsrEf2EBaKf" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*hb52HgmJboQwWvVL" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*NBKWZ3zNTtRj3O8C" /></figure><blockquote><em>The changes may take a minute to take hold of but once they do, you are all set. If the changes are correct the lambda function we created will trigger each time a user visits the site and posts the time in DynamoDB.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*0JhfbTSEb27d-MaK" /></figure><h4>Task 3: Implement a CI/CD Pipeline:</h4><p><strong>Objectives:</strong></p><ul><li><strong>Source Code Management:</strong> Use CodeCommit to manage the website’s source code.</li><li><strong>Continuous Integration</strong> <strong>and Deployment:</strong> Use CodeBuild and CodeDeploy to automate the build and deployment process.</li><li><strong>Approval Process:</strong> Implement a manual approval step before deploying to production.</li></ul><h4>Source Code Management:</h4><blockquote><strong><em>contributor | </em></strong><a href="https://medium.com/@kennethbarnesjr.2"><strong><em>Kenneth Barnes</em></strong></a></blockquote><h4>Version Control and Repository Setup:</h4><ul><li><strong>AWS CodeCommit</strong> is a <strong>version control service</strong> hosted by Amazon Web Services (AWS). It will allow us to privately store and manage assets such as documents, source code, and binary files in the cloud for the Vitality Sphere Website.</li><li><strong>Cloud9 </strong>is a cloud-based integrated development environment (IDE) that lets you write, run, and debug your code within a browser.</li></ul><p><strong>Objective:</strong><br>To create a central repository in CodeCommit for the Vitality Sphere website files.</p><p><strong>Steps:</strong></p><ol><li>Head to the <strong>CodeCommit</strong> service.</li><li>Click on the <strong>Repositories</strong> tab, then click “Create repository” and fill out your information as needed.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*l3-wxpQ_KtTCLjH_" /><figcaption>CodeCommit Repository Creation</figcaption></figure><h4>Setting up Cloud9 Instance to manually push files:</h4><p><strong>Steps:</strong></p><ol><li>Now head to the <strong>Cloud9</strong> service and start the process of creating an environment.</li><li>I used most of the default<strong> </strong>settings to create this environment.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*I7IoX58RKXoHyEK9" /></figure><p><strong>IAM</strong> roles are created to allow me to remote into the instance using the <strong>SSM </strong>service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*YP8AW-vi-j0TDFJN" /></figure><p>3. Copy the git line that’s under step 3 to clone the CodeCommit repository and paste it within the Cloud9 instance. Then use ( cd &lt; Repository Name &gt; ) to be within the repository to push the Vitality Sphere website files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*Fk7KWIxYdAT6nS5X" /><figcaption>The steps are within the image above</figcaption></figure><h4>Continuous Integration and Deployment:</h4><blockquote><strong><em>contributor | </em></strong><a href="https://medium.com/@kennethbarnesjr.2"><strong><em>Kenneth Barnes</em></strong></a></blockquote><p><strong>Continuous Integration and Deployment </strong>is huge within Cloud DevOps, it ensures fast releases and provides efficiency when deploying.</p><p><strong>CodeBuild </strong>is a fully managed build service that compiles source code, runs tests, and produces software packages that are ready to deploy.</p><p><strong>CodePipeline </strong>is a continuous delivery service that automates the build, test, and deploy phases of your release process every time there is a code change, based on the release model that is defined.</p><p><strong>Objective:</strong></p><ol><li>Configuring AWS CodeBuild to compile and test code from our repository, ensuring code integrity before deployment.</li><li>Implement an AWS CodePipeline to automate the continuous integration and delivery process for the serverless environment. We will also configure the pipeline to AWS CodeCommit repository within the Vitality Sphere account, and ensure that updates to the repository will trigger the deployment process appropriately.</li><li>Establish an initial deployment stage in AWS CodePipeline to deploy artifacts to the development S3 bucket and test changes in a live environment.</li></ol><h4>Integrate AWS CodeBuild for Code Compilation and Testing:</h4><p><strong>Steps:</strong></p><ol><li>Navigate to<strong> CodeBuild </strong>then on the left-hand side click on the “<em>Build projects</em>” tab and click Orange “<em>Create project</em>” to start the process of the Build Environment. The Source is from the <strong>CodeCommit</strong> repository that I have created earlier.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*z0Lg6SDo3CQ5lmtY" /><figcaption>Note: Within CodeBuild I used an existing role of CodeBuildRole. This role will allow the CodeBuild project to have AWSCodeBuildAdminAccess and Customer Managed policies to complete the following tasks in the project.</figcaption></figure><blockquote><em>Within this Project I used a </em><strong><em>buildspec.yaml</em></strong><em> file to define what</em><strong><em> CodeBuild</em></strong><em> should do during the build phase — This is very important!</em></blockquote><p>2. Now head to <strong>Cloud9 </strong>to push the website files into the <strong>CodeCommit </strong>repository using the following commands:</p><ul><li><strong>git add </strong>( # This command gets the next commit command ready for any modifications that have occurred in the working directory.)</li><li><strong>git commit -m “first commit”</strong> ( # This command makes a snapshot of the changes that were made when the <strong>git add</strong> command was used. The -m option lets you leave a commit message and my message was the “first commit”.)</li><li><strong>git push </strong>( # This command allows us to push the files that we saved within the working directory into the CodeCommit repository.)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*GJW93BbzGK6MFjvD" /><figcaption>Note: Make sure to save the files that you’re working on, because if you don’t save the file or files you will get a warning message, also make sure you’re in the correct directory that you want to work in.</figcaption></figure><p><em>Then I ran a test within CodeBuild and it was able to succeed In doing certain checks before the deployment stage.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*xJ0_7hgTuWflJXgY" /></figure><h4>Configure AWS CodePipeline with AWS CodeCommit Repository &amp; Automate Deployment to Development Environment:</h4><p><strong>Steps:</strong></p><ol><li>Navigate to<strong> CodePipeline </strong>then on the left-hand side click on the “<em>Pipelines</em>” tab and click Orange “<em>Create pipeline</em>” to start the process of the CICD Pipeline.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*piW2oEl0vhxMhr58" /><figcaption>Within CodePipeline I used an existing role of CodepipelineRole. This role will allow the CodePipeline service to have AWSCodePipeline_FullAccess and Customer Managed policies to complete the following tasks in the project.</figcaption></figure><p>2. When finishing the <strong>CodePipeline</strong> I went back to the <strong>Cloud9 </strong>instance to make a test file and push that file to the<strong> CodeCommit</strong> repository to see if the <strong>CodePipeline </strong>is functioning correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*1CjACBer7sUtiOtg" /><figcaption>Cloud9 test file push to CodeCommit</figcaption></figure><p>3. Once I pushed the code to the <strong>CodeCommit</strong> repository, as seen in the image above, a CloudWatchEvent was triggered to let CodePipeline know to start the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*937rA5Ve8fsEioZG" /><figcaption>In the image above, the CodePipeline went through the pipeline workflow and succeeded.</figcaption></figure><p>4. Then I went ahead and created a Deployment Stage within the <strong>CodePipeline</strong> that will output the information that is within the <strong>CodeCommit</strong> repository into the Dev S3 bucket that we have within this project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*-K9vgcklOGsVODpe" /><figcaption>In the image above I went to the Dev S3 Bucket to create a folder for the output of the deployment stage when the CodePipeline is triggered. Update: For this project it’s incorrect, so I just clicked the “Extract file before deploy” and that section above is optional. So I just left it blank and the code will go straight to the bucket and not the folder that is within the bucket.</figcaption></figure><h4>Implement a manual approval step before deploying to production:</h4><blockquote><em>contributor | </em><a href="https://medium.com/@hadianoor16"><em>Hadia Noo</em></a>r</blockquote><p>Once code changes have been deployed to the Dev bucket successfully, the next task will be to deploy to the Prod bucket. Since this is crucial to directly deploy to the Prod bucket, we can add a manual approval stage in our CodePipeline so changes are approved first before sending them out to end users.</p><p>Manual approval can be added later in the Pipeline so go to your pipeline and edit. Right after the Deploy stage to the Dev S3 bucket, click ‘Add Stage’ and name this stage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*voRAcv5bz4Vir4_K" /><figcaption>Add stage</figcaption></figure><p>Once the stage is created, click ‘Add Action Group’ and select ‘Manual Approval’ for Action Provider.</p><p>URL for review is optional but it’s a good practice to review the Dev bucket once before we give the go-ahead to deploy those changes in Prod. Hence, I used the Dev bucket URL.</p><p><a href="https://docs.aws.amazon.com/sns/latest/dg/sns-create-topic.html">https://docs.aws.amazon.com/sns/latest/dg/sns-create-topic.html</a></p><p><a href="https://docs.aws.amazon.com/sns/latest/dg/sns-create-subscribe-endpoint-to-topic.html">https://docs.aws.amazon.com/sns/latest/dg/sns-create-subscribe-endpoint-to-topic.html</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*NN5gvEmoFh5RMy7f" /></figure><p>Now ‘<strong>Add Action Group</strong>’ again for the Manual-Approval-Production stage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*neZHup1BfT2eAK6v" /></figure><p>Now for ‘<strong>Action Provider</strong>’ choose S3 bucket and select your Prod bucket from dropdown. Choose ‘<strong>Extract file before deploy</strong>’ and click <strong>Done</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*6bdl0qzk6oElEG_c" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*RNX1GxNpS5DtRdm6" /><figcaption>Manual Approval to Production</figcaption></figure><p>Scroll up and <strong>Save pipeline</strong>.</p><p>Now time to test the changes, trigger the pipeline by making some code changes in CodeCommit Repo and the pipeline will be triggered. The changes are deployed to the Dev bucket right away, but the pipeline will stop at the Manual-Approval-Production step to be approved by developers before it continues execution to the Prod bucket. If you are subscribed to the SNS topic, you will receive an email notification like below. Follow the link to approve/reject.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*4Dd5LBDIzPESgykU" /></figure><h4>Testing the CI/CD:</h4><p>I changed the title in the index.html page in CodeCommit that triggered the Pipeline. It executed the deployment stage. The dev bucket shows the changes made to the webpage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*t3RsdUKVGjHpiGdh" /></figure><p>Now, the Approval stage is in the Pending state. Click Review and “Approve” to proceed to prod.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/0*nw5m-YL9oL0E1_WJ" /></figure><p>Once it’s approved, the pipeline continues its operation and performs the next step which is to deploy the changes to the Prod environment.</p><p>When the deployment to the Production bucket shows succeeded, head out to the Prod S3 bucket to see if the changes are reflected.</p><p>Also, remember that our prod S3 bucket is being served by CloudFront, and Route 53 points to the company’s domain to the CloudFront distribution.</p><p>Copy the CloudFront Distribution domain name and see the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*TNPmjHhvkjOrSbBb" /></figure><p>Copy the company’s domain name <em>pod1.vitality.luitprojects.com</em> and paste it into the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*HzXni_GPpMKNUu67" /></figure><p>Hence our end users are being served with the updated content via CloudFront.</p><p>You must remember that since CloudFront caches the object in the local cache till TTL expires, the user might still see the old content. For testing purposes, I kept the caching Disabled.</p><h4>Security and Compliance:</h4><p><strong>Security Best Practices: </strong><em>contributors \ </em><a href="https://medium.com/@naperry2011"><em>Nicholas Perry</em></a></p><ul><li>Apply appropriate bucket policies to secure the S3 buckets.</li><li>Use IAM roles and policies to grant the necessary permissions to Lambda, API Gateway, and other AWS services.</li></ul><p><strong>Compliance:</strong></p><ul><li>Follow the provided naming standards for all AWS resources.</li></ul><h4>IAM Roles and Permissions:</h4><p><strong>Objective:</strong> Ensure IAM roles and permissions adhere to the principle of least privilege and are properly configured.</p><p><strong>Steps:</strong></p><h4>Review IAM Policies:</h4><ul><li>Analyze each IAM role and attached policies.</li><li>Ensure roles have the minimum necessary permissions.</li></ul><h4>Roles and Attached Policies:</h4><p><strong>AWSCloud9SSMInstanceProfile</strong></p><ul><li><strong>Permissions: </strong>Ensure the role has the necessary permissions for AWS Cloud9 instances, but no more.</li></ul><h4>— AdministratorAccess</h4><ul><li><strong>Permissions: </strong>Ensure this role is limited to administrators and used sparingly.</li></ul><h4>— ReadOnlyAccess</h4><ul><li><strong>Permissions: </strong>Confirm this role has only read-only access.</li></ul><h4>— PowerUserIAMPolicy</h4><ul><li><strong>Permissions: </strong>Ensure this role provides necessary access without administrative privileges.</li></ul><h4>— APIGatewayServiceRolePolicy</h4><ul><li><strong>Permissions: </strong>Verify the role has permissions for managing API Gateway resources.</li></ul><h4>— AWSApplicationAutoscalingDynamoDBTablePolicy</h4><ul><li><strong>Permissions: </strong>Ensure the role has the necessary permissions for autoscaling DynamoDB tables.</li></ul><h4>— AWSCloud9ServiceRolePolicy</h4><ul><li><strong>Permissions: </strong>Verify the role has permissions required for AWS Cloud9.</li></ul><h4>— AWSOrganizationsServiceTrustPolicy</h4><ul><li><strong>Permissions: </strong>Confirm the role has the appropriate permissions for AWS Organizations.</li></ul><h4>— AWSSSOServiceRolePolicy</h4><ul><li><strong>Permissions: </strong>Ensure the role has the necessary permissions for AWS SSO.</li></ul><h4>— AWSSupportServiceRolePolicy</h4><ul><li><strong>Permissions: </strong>Verify the role has permissions for AWS Support.</li></ul><h4>— Cloud9Role</h4><ul><li><strong>Permissions: AmazonS3FullAccess</strong></li><li>Confirm this access is necessary and limit it to specific buckets if possible.</li></ul><h4>— AWSCodeCommitFullAccess</h4><ul><li>Ensure this is required for the role’s purpose.</li></ul><h4>— CodeBuildRole</h4><ul><li><strong>Permissions: AWSCodeBuildAdminAccess</strong></li><li>Confirm administrative access is necessary.</li></ul><h4>— CodeBuildBasePolicy-CodeBuildRole-us-east-1</h4><ul><li>Verify base policy permissions.</li></ul><h4>— AWSCodeDeployRole</h4><ul><li><strong>Permissions: </strong>Ensure it has the necessary permissions for CodeDeploy and nothing more.</li></ul><h4>— CodePipelineRole</h4><ul><li><strong>Permissions: AWSCodePipeline_FullAccess</strong></li><li>Verify full access is required.</li></ul><h4>— CodePipelinePolicy</h4><ul><li>Review and confirm necessary permissions.</li></ul><h4>— cwe-role-us-east-1-test</h4><ul><li><strong>Permissions: start-pipeline-execution-us-east-1-test</strong></li><li>Ensure it only has permissions to start pipeline execution.</li></ul><h4>— cwe-role-us-east-1-VitalitySphere-Streamline</h4><ul><li><strong>Permissions: codepipeline</strong></li><li>Confirm this role has the minimal necessary permissions.</li></ul><h4>— cwe-role-us-east-1-VitalitySphere-Dev-Pipeline-001-CI-CD</h4><ul><li><strong>Permissions: codepipeline</strong></li><li>Ensure it only has permissions to start pipeline execution.</li></ul><h4>Decommission Old EC2 Server After Successful Migration:</h4><p><em>contributor | </em><a href="https://medium.com/@hadianoor16"><em>Hadia Noor</em></a></p><p>As Vitality Sphere achieved a more scalable, cost-effective, and efficient infrastructure for their website by migrating their website to S3 bucket and CloudFront, their next task is to decommission the old EC2 instances while making sure no other services get interrupted and there is no downtime for the users.</p><p>However, before shutting down the EC2 instances, cloud engineers need to make sure that 100% of the traffic is directed to the new production environment and that there are no reported issues for the specified period.</p><p>Once this is confirmed, go to EC2 instances, and click on your running instance -&gt; Instance State -&gt; Terminate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*N1sZkFsq8o97y8LM" /></figure><p>Terminate old EC2 instance.</p><h4>Summary:</h4><p>By completing these tasks, Vitality Sphere will achieve a more scalable, cost-effective, and efficient infrastructure for its website, along with valuable insights into user interactions and a streamlined deployment process.</p><h4>Final Deliverables:</h4><ol><li><strong>Migrated Website:</strong></li></ol><ul><li>A static website hosted on S3, served through CloudFront, with DNS pointed by Route 53.</li></ul><p><strong>2. User Interaction API:</strong></p><ul><li>An API that triggers a Lambda function to record user interactions in DynamoDB.</li></ul><p><strong>3. CI/CD Pipeline:</strong></p><ul><li>A fully functioning CI/CD pipeline with automated build and deployment processes, including a manual approval step.</li></ul><p>This project could not have been possible without the amazing effort put forth by all my teammates at Level-Up-In-Tech: ( <a href="https://medium.com/@naperry2011">Nicholas Perry</a>, <a href="https://medium.com/@hadianoor16">Hadia Noor</a>, <a href="https://medium.com/@kennethbarnesjr.2">Kenneth Barnes</a>, <a href="https://medium.com/@aparker735">Aynda Parker</a>, <a href="https://medium.com/@markeeta.d.little">Dionne Little</a>, <a href="https://medium.com/@mrskeetonthe1">Jessica Ross</a>, &amp; <a href="https://medium.com/@labossiere01">John Labossiere</a>). Stay tuned for more cloud tips!!!</p><p><strong>References</strong>:</p><p><a href="https://blog.logrocket.com/product-management/fibonacci-sequence-story-points-agile/">Agile estimation: Using the Fibonacci sequence for story points — LogRocket Blog</a></p><p><a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/integrations-action-type.html#w2aac12b9c13b7">Integrations with CodePipeline action types — AWS CodePipeline (amazon.com)</a><a href="https://www.youtube.com/watch?v=e90rz62rk-8">https://www.youtube.com/watch?v=e90rz62rk-8</a></p><p><a href="https://www.youtube.com/watch?v=e90rz62rk-8">https://www.youtube.com/watch?v=e90rz62rk-8</a></p><p><a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-s3deploy.html">https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-s3deploy.html</a></p><p><a href="https://medium.com/tag/cloudfront?source=post_page-----890070d630e0--------------------------------">Cloudfront</a>, <a href="https://medium.com/tag/lambda?source=post_page-----890070d630e0--------------------------------">Lambda</a>, <a href="https://medium.com/tag/cicd?source=post_page-----890070d630e0--------------------------------">Cicd</a>, <a href="https://medium.com/tag/dyanmodb?source=post_page-----890070d630e0--------------------------------">Dyanmodb</a>, <a href="https://medium.com/tag/route-53?source=post_page-----890070d630e0--------------------------------">Route 53</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1b442dc8ad5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From On-Premises to the Cloud: A Journey to Azure Blob Storage]]></title>
            <link>https://medium.com/@mrskeetonthe1/from-on-premises-to-the-cloud-a-journey-to-azure-blob-storage-6a298313f42e?source=rss-694a3fb4bf91------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a298313f42e</guid>
            <category><![CDATA[static-websites]]></category>
            <category><![CDATA[blob-storage]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Jessica Ross How I became a Cloud DevOps Engineer!]]></dc:creator>
            <pubDate>Sat, 02 Nov 2024 23:02:19 GMT</pubDate>
            <atom:updated>2024-11-02T23:02:19.829Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*75QLDCXxX_-M3M9bUGXcOw.png" /></figure><p>In the fast-paced world of fintech, every second counts. For Level Up Bank, a fictitious startup dedicated to providing seamless digital banking services, the need for a reliable and efficient website is paramount. In this post, we’ll explore how Level Up Bank transitioned from an on-premises server to Azure Blob Storage, resulting in cost savings, improved scalability, and reduced management overhead.</p><h3>Step 1: Creating an Azure Storage Account</h3><p>First things first, let’s set up an Azure Storage account. This is your gateway to utilizing Azure’s powerful storage solutions.</p><ol><li><strong>Log into the Azure Portal</strong>: Navigate to <a href="https://portal.azure.com/">portal.azure.com</a>.</li></ol><p><strong>2. Create a Storage Account</strong>:</p><ul><li>Click on “Create a resource.”</li><li>Select “Storage” &gt; “Storage account.”</li><li>Fill in the required fields:</li><li><strong>Subscription</strong>: Choose your Azure subscription.</li><li><strong>Resource group</strong>: Create a new one or select an existing one.</li><li><strong>Storage account name</strong>: Pick a unique name (e.g., levelupbankstorage).</li><li><strong>Region</strong>: Select a location close to your user base for better performance.</li><li><strong>Performance</strong>: Choose “Standard.”</li><li><strong>Replication</strong>: Opt for “LRS” (Locally Redundant Storage).</li></ul><p><strong>3. Review and Create</strong>: Review your settings and hit “Create.”</p><h3>Step 2: Creating a Blob Container</h3><p>Now that you have your storage account set up, it’s time to create a container for your website files.</p><ol><li><strong>Navigate to Your Storage Account</strong>: In the Azure Portal, find and click on your newly created storage account.</li></ol><p><strong>2. Create a Blob Container</strong>:</p><ul><li>Click on “Containers” in the left menu.</li><li>Click on “+ Container.”</li><li>Enter a name for your container (e.g., webcontent) and set the public access level to “Blob (anonymous read access for blobs only).”</li><li>Click “OK” to create the container.</li></ul><h3>Step 3: Uploading Your index.html File</h3><p>With the container ready, let’s upload the main file for your website.</p><ol><li><strong>Upload the HTML File</strong>:</li></ol><ul><li>Click on your blob container (webcontent).</li><li>Click on “Upload.”</li><li>Browse for your index.html file and upload it.</li></ul><h3>Step 4: Configuring Static Website Hosting</h3><p>Next, we’ll configure your blob container to serve as a static website.</p><ol><li><strong>Static Website Settings</strong>:</li></ol><ul><li>In your storage account, scroll down to find “Static website” under the “Settings” section.</li><li>Enable the static website hosting feature.</li><li>Set the “Index document name” to index.html.</li><li>(Optional) Specify an error document if desired (e.g., 404.html).</li><li>Save the settings.</li></ul><p><strong>2. Note the Primary Endpoint</strong>: This is the URL where your website will be accessible. You’ll need it in the next step.</p><h3>Step 5: Verifying Access</h3><p>To ensure everything is set up correctly, let’s test your static website.</p><ul><li><strong>Open a Private or Incognito Browser</strong>: This helps avoid any cached data.</li><li><strong>Navigate to the Primary Endpoint</strong>: Use the URL from the previous step to access your website.</li><li><strong>Check for Accessibility</strong>: You should see your index.html rendered properly.</li></ul><h3>Advanced (Optional): Enhance with Azure CDN</h3><p>To take your website to the next level, consider integrating Azure CDN.</p><h3>Step 6: Integrate Azure CDN</h3><ol><li><strong>Create a CDN Profile</strong>:</li></ol><ul><li>In the Azure Portal, click on “Create a resource.”</li><li>Search for “CDN” and select “CDN.”</li><li>Fill in the necessary details, such as the resource group and name for your CDN profile.</li></ul><p><strong>2. Create a CDN Endpoint</strong>:</p><ul><li>Once the CDN profile is created, add a new endpoint.</li><li>Select your Azure Blob Storage as the origin.</li></ul><h3>Step 7: Configure HTTPS and Redirect HTTP to HTTPS</h3><ol><li><strong>Enable HTTPS</strong>:</li></ol><ul><li>In your CDN endpoint settings, enable HTTPS.</li><li>Choose the appropriate option for redirecting HTTP traffic to HTTPS.</li></ul><h3>Step 8: Testing the CDN Endpoint</h3><ul><li><strong>Access Your Website via CDN</strong>: Use the CDN endpoint URL to view your website.</li><li><strong>Verify HTTPS Redirection</strong>: Ensure that HTTP requests automatically redirect to HTTPS.</li></ul><h3>Step 9: Test Caching Behavior</h3><ul><li><strong>Modify </strong><strong>index.html</strong>: Make a small change to the file and upload it to the blob container.</li><li><strong>Observe Behavior</strong>: Check both the direct Blob URL and the CDN endpoint to see how caching affects content delivery.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a298313f42e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leveling Up with Docker Swarm: Deploying a Resilient, Scalable Infrastructure for Level Up…]]></title>
            <link>https://medium.com/@mrskeetonthe1/leveling-up-with-docker-swarm-deploying-a-resilient-scalable-infrastructure-for-level-up-25f71b9ce299?source=rss-694a3fb4bf91------2</link>
            <guid isPermaLink="false">https://medium.com/p/25f71b9ce299</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[docker-swarm]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Jessica Ross How I became a Cloud DevOps Engineer!]]></dc:creator>
            <pubDate>Fri, 01 Nov 2024 01:50:00 GMT</pubDate>
            <atom:updated>2024-11-01T01:50:00.501Z</atom:updated>
            <content:encoded><![CDATA[<h3>Leveling Up with Docker Swarm: Deploying a Resilient, Scalable Infrastructure for Level Up Publications.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*D9pxK5uO3wAENMcB3tgmWQ.jpeg" /></figure><p>As businesses scale to meet user demands, a robust, flexible infrastructure becomes essential. For Level Up Publications, an online IT publication with a growing readership, migrating to a containerized environment with Docker Swarm offers a scalable, efficient, and resilient solution. Docker Swarm manages and scales applications by balancing load, automating recovery, and efficiently utilizing resources, making it a compelling choice for managing dynamic traffic and ensuring uninterrupted service.</p><p>In this step-by-step guide, we’ll deploy a basic Docker Swarm infrastructure that meets the requirements of Level Up Publications. This guide covers the creation of a 3-node Docker Swarm cluster, setup of isolated frontend and backend networks, and deployment of MySQL and WordPress services. Along the way, we’ll ensure high availability and data persistence — critical for maintaining uptime and protecting valuable content.</p><h3>Prerequisites</h3><p>Before you start, ensure you have the following:</p><ul><li>Docker installed on each node in your cluster</li><li>A minimum of three nodes (one manager node and two worker nodes)</li><li>Basic familiarity with Docker and Docker Swarm CLI</li></ul><h3>Step 1: Initialize Docker Swarm on the Manager Node</h3><ol><li><strong>Log into the Manager Node</strong> and initialize Docker Swarm:</li></ol><pre>docker swarm init --advertise-addr &lt;MANAGER_IP&gt;</pre><p>This command outputs a unique token, which you’ll use to join worker nodes to the Swarm.</p><p><strong>2. Join Worker Nodes</strong> to the Swarm:</p><ul><li>On each worker node, run:</li></ul><pre>docker swarm join --token &lt;TOKEN&gt; &lt;MANAGER_IP&gt;:2377</pre><p>After joining, you can confirm the setup by listing nodes from the manager:</p><pre>docker node ls</pre><h3>Step 2: Create Docker Networks</h3><p>Create two separate networks for the frontend and backend services. This segmentation allows greater security and organizational efficiency.</p><ol><li><strong>Create Backend Network</strong> for MySQL:</li></ol><pre>docker network create --driver overlay backend</pre><p><strong>2. Create Frontend Network</strong> for WordPress:</p><pre>docker network create --driver overlay frontend</pre><h3>Step 3: Deploy MySQL Service</h3><p>MySQL will serve as our backend database for WordPress, and it’s crucial to ensure data persists across container restarts.</p><ol><li><strong>Create a Volume</strong> for Data Persistence:</li></ol><pre>docker volume create mysql_data</pre><p><strong>2. Deploy the MySQL Service</strong>:</p><pre>docker service create \<br>  --name mysql \<br>  --network backend \<br>  --replicas 1 \<br>  --env MYSQL_ROOT_PASSWORD=&lt;your-root-password&gt; \<br>  --env MYSQL_DATABASE=wordpress \<br>  --env MYSQL_USER=wp_user \<br>  --env MYSQL_PASSWORD=&lt;wp_user_password&gt; \<br>  --mount type=volume,source=mysql_data,target=/var/lib/mysql \<br>  mysql:latest</pre><p><strong>Explanation</strong>:</p><ul><li>--network backend: Connects the MySQL service to the backend network.</li><li>--mount type=volume...: Ensures data persistence.</li></ul><p><strong>3. Verify Deployment</strong>:</p><pre>docker service ls</pre><h3>Step 4: Deploy WordPress Service</h3><p>WordPress will act as our frontend, running on port 80 and connecting to the backend MySQL service.</p><ol><li><strong>Deploy the WordPress Service</strong>:</li></ol><pre>docker service create \<br>  --name wordpress \<br>  --network frontend \<br>  --network backend \<br>  --replicas 3 \<br>  -p 80:80 \<br>  --env WORDPRESS_DB_HOST=mysql:3306 \<br>  --env WORDPRESS_DB_USER=wp_user \<br>  --env WORDPRESS_DB_PASSWORD=&lt;wp_user_password&gt; \<br>  --env WORDPRESS_DB_NAME=wordpress \<br>  wordpress:latest</pre><p><strong>Explanation</strong>:</p><ul><li>--network frontend: Connects the service to the frontend network.</li><li>--network backend: Allows WordPress to communicate with MySQL.</li><li>-p 80:80: Exposes WordPress on port 80.</li><li>--replicas 3: Deploys three replicas of WordPress for high availability.</li></ul><p><strong>2. Verify Service Health</strong>:</p><pre>docker service ps wordpress</pre><h3>Step 5: Access WordPress and Complete Setup</h3><p>Once deployed, access your WordPress site by navigating to http://&lt;MANAGER_IP&gt; in your browser. If all went well, you’ll see the WordPress setup screen.</p><ol><li>Enter the MySQL database credentials to link WordPress with your MySQL service:</li></ol><ul><li><strong>Database Name</strong>: wordpress</li><li><strong>Username</strong>: wp_user</li><li><strong>Password</strong>: &lt;wp_user_password&gt;</li><li><strong>Database Host</strong>: mysql</li></ul><p>2. Complete the WordPress setup.</p><h3>Step 6: Test Scaling and Resilience</h3><p>To test Docker Swarm’s scaling capability, scale your WordPress service up or down based on traffic:</p><pre>docker service scale wordpress=&lt;desired-replica-count&gt;</pre><p>You can also test resilience by stopping one of the WordPress replicas:</p><pre>docker service update --replicas 2 wordpress</pre><p>Docker Swarm will automatically restart the failed container, ensuring service continuity.</p><h3>Additional Tips for Security and Optimization</h3><ul><li><strong>Docker Secrets</strong>: Use Docker secrets to securely manage sensitive data (like passwords).</li><li><strong>Monitoring</strong>: Tools like Prometheus and Grafana can help monitor your Swarm infrastructure’s performance.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25f71b9ce299" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automate EC2 Cost Savings: A DevOps Solution to Stop Instances After Hours Using AWS Lambda and…]]></title>
            <link>https://medium.com/@mrskeetonthe1/automate-ec2-cost-savings-a-devops-solution-to-stop-instances-after-hours-using-aws-lambda-and-946b61f27913?source=rss-694a3fb4bf91------2</link>
            <guid isPermaLink="false">https://medium.com/p/946b61f27913</guid>
            <category><![CDATA[script]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[lamda]]></category>
            <dc:creator><![CDATA[Jessica Ross How I became a Cloud DevOps Engineer!]]></dc:creator>
            <pubDate>Fri, 01 Nov 2024 00:59:49 GMT</pubDate>
            <atom:updated>2024-11-01T01:25:30.440Z</atom:updated>
            <content:encoded><![CDATA[<h3>Automate EC2 Cost Savings: A DevOps Solution to Stop Instances After Hours Using AWS Lambda and Python.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OyBPN93u6g5qQfrO1NK2Bw.png" /></figure><p>In many DevOps environments, development labs serve as essential spaces to test and validate code releases before they hit production. However, these labs can also incur significant costs if not managed effectively. Our DevOps team recently faced this challenge as managers pointed out the rising expenses associated with our development lab. To help cut costs, we implemented an automation solution to ensure our EC2 instances are stopped when no one is working.</p><p>In this post, we’ll walk through how to:</p><ul><li>Write a Python script to stop EC2 instances.</li><li>Deploy this script using AWS Lambda.</li><li>Configure a CloudWatch trigger to run the Lambda function every day at 7:00 pm to ensure that instances are stopped after hours.</li></ul><h3>Prerequisites</h3><ul><li><strong>AWS Account</strong>: Access to AWS services like Lambda, CloudWatch, and EC2.</li><li><strong>AWS CLI</strong>: For deploying and configuring AWS services locally.</li><li><strong>IAM Permissions</strong>: Permissions for EC2 and Lambda services.</li></ul><h3>Step 1: Create a Python Script to Stop EC2 Instances</h3><p>First, let’s write a simple Python script to stop all running EC2 instances in the specified region. This script leverages the AWS boto3 library to interact with EC2.</p><h4>Python Script: stop_instances.py</h4><pre>import boto3<br><br>def stop_instances():<br>    ec2 = boto3.client(&#39;ec2&#39;, region_name=&#39;us-west-2&#39;)  # specify your region<br>    # Fetch all instances with the &#39;running&#39; state<br>    instances = ec2.describe_instances(<br>        Filters=[{&#39;Name&#39;: &#39;instance-state-name&#39;, &#39;Values&#39;: [&#39;running&#39;]}]<br>    )<br><br>    # Collect instance IDs<br>    instance_ids = [<br>        instance[&#39;InstanceId&#39;]<br>        for reservation in instances[&#39;Reservations&#39;]<br>        for instance in reservation[&#39;Instances&#39;]<br>    ]<br><br>    if instance_ids:<br>        print(f&quot;Stopping instances: {instance_ids}&quot;)<br>        ec2.stop_instances(InstanceIds=instance_ids)<br>    else:<br>        print(&quot;No running instances to stop.&quot;)</pre><p>In this script:</p><ul><li>We initialize an EC2 client using boto3.</li><li>We filter for instances with the running state.</li><li>If there are any running instances, we stop them by calling stop_instances().</li></ul><h3>Step 2: Create an AWS Lambda Function</h3><p>With our script complete, we can now deploy it using AWS Lambda to automatically stop our instances each day after hours.</p><ol><li><strong>Navigate to AWS Lambda Console</strong>: Open the <a href="https://console.aws.amazon.com/lambda">AWS Lambda Console</a>.</li></ol><p><strong>2. Create a New Function</strong>:</p><ul><li>Choose “Create function.”</li><li>Select “Author from scratch.”</li><li>Enter a name, such as StopEC2Instances.</li><li>Choose Python 3.8 (or higher) as the runtime.</li></ul><p><strong>3. Configure the Execution Role</strong>:</p><ul><li>Select “Create a new role with basic Lambda permissions.”</li><li>Attach the <strong>EC2FullAccess</strong> policy to this role to allow Lambda to stop instances.</li></ul><p><strong>4. Write Code in Lambda Console</strong>:</p><ul><li>Copy and paste the code from stop_instances.py into the function code editor in the Lambda console.</li><li>Update the Lambda handler to stop_instances.stop_instances.</li></ul><h3>Step 3: Schedule the Lambda Function Using CloudWatch Events</h3><p>To ensure this function runs daily at 7:00 pm, let’s set up a CloudWatch Events rule to trigger the Lambda function on a fixed schedule.</p><ol><li><strong>Go to CloudWatch Console</strong>:</li></ol><ul><li>Open the <a href="https://console.aws.amazon.com/cloudwatch">CloudWatch Console</a>.</li><li>Navigate to “Rules” and select “Create rule.”</li></ul><p><strong>2. Set Schedule</strong>:</p><ul><li>Choose “Event Source” as “Schedule.”</li><li>Enter a cron expression like cron(0 19 * * ? *) to trigger at 7:00 pm UTC daily. (Note: Adjust to your time zone if needed).</li></ul><p><strong>Target the Lambda Function</strong>:</p><ul><li>Under “Targets,” select “Lambda function.”</li><li>Choose the StopEC2Instances Lambda function.</li><li>Save the rule with a descriptive name, like StopDevInstancesAfterHours.</li></ul><p>This CloudWatch rule will now trigger our Lambda function daily at 7:00 pm, ensuring any running instances in our development environment are automatically stopped.</p><h4>Step 4: Testing the Lambda Function</h4><p>To test the Lambda function:</p><ul><li><strong>Test Locally</strong>: Update the Lambda function to run at a different time temporarily to observe instance shutdown.</li><li><strong>Test in AWS</strong>: Execute the Lambda function manually from the AWS console to confirm it correctly stops any running instances.</li></ul><h3>Step 5: Push Code to GitHub</h3><ul><li>Initialize a new repository in GitHub.</li><li>Add the stop_instances.py script.</li><li>Add a README.md file explaining the purpose and use of the Lambda function.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=946b61f27913" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automate Your Web Deployments: Building a CI/CD Pipeline with AWS CodePipeline.]]></title>
            <link>https://medium.com/@mrskeetonthe1/automate-your-web-deployments-building-a-ci-cd-pipeline-with-aws-codepipeline-ce80cf296f94?source=rss-694a3fb4bf91------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce80cf296f94</guid>
            <category><![CDATA[aws-codepipeline]]></category>
            <category><![CDATA[cicd]]></category>
            <dc:creator><![CDATA[Jessica Ross How I became a Cloud DevOps Engineer!]]></dc:creator>
            <pubDate>Tue, 30 Jul 2024 18:31:46 GMT</pubDate>
            <atom:updated>2024-07-30T18:31:46.468Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ncBrIi-LM7nbqdzhjWy4rQ.jpeg" /></figure><p><em>In modern software development, automation is the key to efficiency and consistency. For teams looking to streamline their deployment process, AWS CodePipeline offers a powerful solution. In this guide, we’ll walk through the process of setting up a Continuous Integration and Continuous Deployment (CI/CD) pipeline for a static website using AWS CodePipeline. We’ll cover everything from creating a repository and setting up an S3 bucket for hosting to adding a manual approval step and implementing CloudFront for better performance.</em></p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>Step 1: Create a New Repository</h4><ul><li>Create a Repository in GitHub:<br> — If using GitHub:<br> — Go to GitHub and create a new repository.<br> — Clone the repository to your local machine.<br> — Add the provided HTML file to the repository.<br> — Commit and push the changes to GitHub.</li></ul><h4>Step 2: Configure an S3 Bucket</h4><ul><li>Create an S3 Bucket for Hosting:<br> — Go to the S3 console.<br> — Click on “Create bucket.”<br> — Provide a unique bucket name and select your preferred region.<br> — Enable static website hosting in the bucket properties.<br> — Note the endpoint URL provided for the static website.</li><li>Set Up Bucket Permissions:<br> — Go to the “Permissions” tab of your bucket.<br> — Edit the bucket policy to allow public read access:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*DoOIaBp_UdDLmHdsUIlgXA.png" /></figure><h4>Step 3: Create a CI/CD Pipeline</h4><ul><li>Create the Pipeline in AWS CodePipeline:<br> — Go to the CodePipeline console.<br> — Click “Create pipeline.”<br> — Name your pipeline and select a new service role.<br> — Click “Next.”</li><li>Configure Source Stage:<br> — For the Source provider, select GitHub or CodeCommit.<br> — Connect your repository and select the branch to use.<br> — Click “Next.”</li><li>Configure Deploy Stage:<br> — Skip the Build stage.<br> — For the Deploy provider, select Amazon S3.<br> — Choose the S3 bucket you created.<br> — Click “Next.”</li><li>Review and Create Pipeline:<br> — Review your settings.<br> — Click “Create pipeline.”</li></ul><h4>Step 4: Deploy and Verify</h4><ul><li>Deploy the Pipeline:<br> — After creating the pipeline, it will automatically run the first time.<br> — Check the S3 bucket to ensure the HTML file is present.</li><li>Verify the Static Website:<br> — Go to the S3 bucket’s static website URL.<br> — Verify that your website is accessible.</li></ul><h4>Step 5: Test the CI/CD Pipeline</h4><ul><li>Make a Change to the Code:<br> — Modify the HTML file (e.g., change some text).<br> — Commit and push the changes to your repository.</li><li>Verify the Pipeline Trigger:<br> — Go to the CodePipeline console and observe the pipeline running.<br> — Verify that the updated website is deployed to the S3 bucket.</li></ul><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>Step 6: Add a Manual Approval Step</h4><ul><li>Add a Manual Approval Action:<br> — Edit your pipeline in the CodePipeline console.<br> — Add a new stage before the Deploy stage.<br> — Add a manual approval action in this new stage.<br> — Configure the action to send an email notification to a senior developer for approval.</li><li>Test the Manual Approval Step:<br> — Make another change to the HTML file.<br> — Commit and push the changes.<br> — Verify that the pipeline waits for manual approval before deploying.</li></ul><h4>Step 7: Implement CloudFront Distribution</h4><ul><li>Create a CloudFront Distribution:<br> — Go to the CloudFront console.<br> — Click “Create Distribution.”<br> — Choose “Web” for the delivery method.<br> — Set the Origin Domain Name to your S3 bucket’s website endpoint.<br> — Configure other settings as needed and create the distribution.</li><li>Update S3 Bucket Policy for CloudFront:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*aBDaAXp3o-j1Zyd_Oripog.png" /></figure><ul><li>Verify CloudFront Distribution:<br> — Once the distribution is deployed, go to the CloudFront URL.<br> — Verify that the website is accessible and performance is improved.</li></ul><h4>Conclusion</h4><p>By following these steps, your team can automate the deployment of your static website using AWS CodePipeline. This setup ensures that every code change is automatically deployed, reducing manual effort and minimizing errors. The advanced steps further enhance the process by adding a manual approval step for quality control and using CloudFront for improved performance.</p><p>Automating your web deployments with AWS CodePipeline not only saves time but also brings consistency, reliability, and scalability to your development workflow. Happy deploying!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce80cf296f94" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lights, Camera, DynamoDB! Managing Media Content with AWS]]></title>
            <link>https://medium.com/@mrskeetonthe1/lights-camera-dynamodb-managing-media-content-with-aws-28fdc0efe1b8?source=rss-694a3fb4bf91------2</link>
            <guid isPermaLink="false">https://medium.com/p/28fdc0efe1b8</guid>
            <category><![CDATA[dynamodb]]></category>
            <category><![CDATA[media-content]]></category>
            <dc:creator><![CDATA[Jessica Ross How I became a Cloud DevOps Engineer!]]></dc:creator>
            <pubDate>Tue, 30 Jul 2024 17:17:26 GMT</pubDate>
            <atom:updated>2024-07-30T17:42:53.843Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Let’s Go! Media Inc., is a dynamic media production and distribution company that creates and distributes movies, TV shows, and other entertainment content to consumers worldwide. As part of their business operations, they need a robust system to manage and track information about their media content, including metadata, ratings, and other relevant details. This blog post will guide you through using AWS DynamoDB to store and manage media content data efficiently.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G2XcnRHM6slarxvQqwvQYA.jpeg" /></figure><h4>Why DynamoDB?</h4><ul><li>Scalability: DynamoDB scales automatically to handle millions of requests per second for demanding applications.</li><li>Performance: Offers single-digit millisecond performance, making it ideal for high-traffic media applications.</li><li>Security: Provides robust security features, including encryption at rest, and fine-grained access control.</li></ul><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><ol><li>Create a DynamoDB Table</li></ol><ul><li>Create the “MediaCatalog” Table:<br> — Open the DynamoDB console.<br> — Click on “Create table.”<br> — Set the table name to `MediaCatalog`.<br> — Set the partition key to `Title` (String).<br> — Leave the sort key blank.<br> — Click “Create.”</li><li>Add 10 Latest Movie Releases:<br> — Go to the “Items” tab in your `MediaCatalog` table.<br> — Click on “Create item.”<br> — Add the following items (replace with your actual data):</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*T64nHPSewRfJ8h2HG7aZ-Q.png" /></figure><p>Repeat for the other 9 movies.</p><p>2. Launch an EC2 Instance</p><ul><li>Create a t2.micro EC2 Instance:<br> — Go to the EC2 console.<br> — Click on “Launch instance.”<br> — Choose the Amazon Linux 2 AMI.<br> — Select the `t2.micro` instance type.<br> — Configure instance details and enable auto-assign public IP.<br> — Add storage (default is fine).<br> — Add a tag (optional).<br> — Configure security group to allow SSH (port 22) from your IP.<br> — Review and launch the instance.</li></ul><p>3. Configure IAM Role for EC2</p><ul><li>Create an IAM Role:<br> — Go to the IAM console.<br> — Click on “Roles” and then “Create role.”<br> — Select “AWS service” and choose “EC2.”<br> — Attach the policy `AmazonDynamoDBReadOnlyAccess`.<br> — Name the role `EC2DynamoDBReadAccess` and create the role.</li><li>Attach IAM Role to EC2 Instance:<br> — Go to the EC2 console.<br> — Select your instance.<br> — Click “Actions,” then “Security,” and “Modify IAM role.”<br> — Attach the `EC2DynamoDBReadAccess` role.</li></ul><p>4. Access DynamoDB from EC2</p><ul><li>Connect to the EC2 Instance:<br> — Use SSH to connect to your instance:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*kTzveLL4OVpsW1YLdgMOsw.png" /></figure><ul><li>Install AWS CLI:<br> — Update the package list and install AWS CLI:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*3ZuSL1CTGMgD8EXyVx6rgg.png" /></figure><ul><li>Configure AWS CLI:<br> — Configure AWS CLI with your IAM role:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*k23yT-CVo6pyG0_2g_aXpQ.png" /></figure><p>5. Scan the DynamoDB Table</p><ul><li>Scan the MediaCatalog Table:<br> — Run the following command to scan the table:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*osN-EP75Uyn98yFidV1SOA.png" /></figure><p>You should see the items you added earlier.</p><p>6. Validate Write Permissions</p><ul><li>Attempt to Write an Item:<br> — Run the following command to attempt a write operation:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*2_yWFIJjTc2r8hiGKWZ6cQ.png" /></figure><p>- You should receive an error indicating that you do not have permission to perform this operation, demonstrating that the IAM role’s permissions are correctly configured.</p><h4>Conclusion</h4><p>By following these steps, Let’s Go! Media Inc. can efficiently manage and track their media content using AWS DynamoDB. The setup ensures that only authorized users can access the data, maintaining the integrity and security of the MediaCatalog. This scalable and secure solution will support the company’s growth and help them make informed decisions about future content creation and distribution.</p><p>With DynamoDB’s robust features, Let’s Go! Media Inc. is well-equipped to handle the demands of a growing media production and distribution business. Happy managing your media in the cloud!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28fdc0efe1b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adventures in the Cloud: Deploying a Scalable Two-Tier Website for Optimal Performance!]]></title>
            <link>https://medium.com/@mrskeetonthe1/adventures-in-the-cloud-deploying-a-scalable-two-tier-website-for-optimal-performance-654d16d78383?source=rss-694a3fb4bf91------2</link>
            <guid isPermaLink="false">https://medium.com/p/654d16d78383</guid>
            <category><![CDATA[2-tier-architecture]]></category>
            <dc:creator><![CDATA[Jessica Ross How I became a Cloud DevOps Engineer!]]></dc:creator>
            <pubDate>Tue, 30 Jul 2024 16:44:40 GMT</pubDate>
            <atom:updated>2024-07-30T16:44:40.107Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PzqgEKVJdwTKIpp36WMRJQ.png" /></figure><p><em>Adventure Works, an innovative travel agency, specializes in organizing adventure tours and travel packages around the globe. As part of their digital strategy, they aim to launch a new website using Joomla as their content management system (CMS). This blog post will guide you through deploying a two-tier architecture on AWS to create a scalable, secure, and highly available Joomla website.</em></p><h4>Why a Two-Tier Architecture?</h4><ul><li>Scalability: Separate web and database servers allow independent scaling to handle increased traffic and data load.</li><li>Security: Isolating the database server enhances security by protecting data storage from the application layer.</li><li>Manageability: Separate management of application and database simplifies maintenance, updates, and scaling.</li><li>Reliability: Using RDS ensures high availability and automated backups, providing robust data protection and disaster recovery.</li></ul><h4>Set Up Networking</h4><ol><li>Create a Custom VPC: <br>* Go to the VPC dashboard in the AWS Management Console.<br>* Create a VPC with a CIDR block (e.g., 10.0.0.0/16).<br>* Create an Internet Gateway and attach it to the VPC.</li></ol><p>2. Create Subnets:<br>* Create two public subnets (e.g., 10.0.1.0/24, 10.0.2.0/24) and two private subnets (e.g., 10.0.3.0/24, 10.0.4.0/24).</p><p>3. Set Up Routing:</p><p>* Create a route table for the public subnets and associate them with the Internet Gateway.<br>* Create a route table for the private subnets and configure routing within the VPC.</p><h4>Set Up the Web Tier</h4><ol><li>Launch an EC2 Instance:<br>* Launch an Ubuntu EC2 instance in one of the public subnets.<br> * Install Apache and Joomla on the instance.</li><li>Install Apache and Joomla:<br> * Connect to the EC2 instance via SSH.<br>* Update the package lists:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*WbvAi-r8KBecRHga3MbbsQ.png" /></figure><p>3. Install Apache:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*5fjAjZTAbYggklBkEFXJjg.png" /></figure><p>4. Install PHP and required extensions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*zWSUf5M3nz87sGiO0a1Y6g.png" /></figure><p>5. Download and extract Joomla:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*pljrvnFqcljAhsfhRN3m2g.png" /></figure><h4>Set Up the Database Tier</h4><ol><li>Launch an RDS Instance:<br>* Launch a MySQL RDS instance in one of the private subnets.<br>* Create a Joomla database and user:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*h3hoeJJAAkdpnl3mebrB_A.png" /></figure><h4>Configure Joomla</h4><ol><li>Complete Joomla Installation:<br> * Open your web browser and navigate to the public IP of your EC2 instance.<br> * Follow the Joomla installation wizard, providing the RDS instance details for the database setup.</li></ol><h4>Security and Best Practices</h4><ol><li>Configure Security Groups:<br>* Create a security group for the EC2 instance allowing HTTP (port 80) and SSH (port 22) traffic.<br>* Create a security group for the RDS instance allowing MySQL/Aurora (port 3306) traffic only from the EC2 instance security group.</li></ol><p>2. Remove Installation Directory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*R6Znn4AOsR_AaZD7pzKS-w.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — -Advanced Setup</p><p><strong><em>Use Case:</em></strong><em> The company plans to deploy an advanced infrastructure that includes multiple EC2 instances behind an Application Load Balancer (ALB). This setup will ensure the website can handle increased traffic and provide a seamless user experience even during peak times.</em></p><h4>Deploy an Additional EC2 Instance</h4><ol><li>Launch a Second EC2 Instance:</li></ol><ul><li>Launch another EC2 instance in a different public subnet.</li><li>Repeat the Joomla installation steps or automate with a script.</li></ul><p>2. Automate Joomla Installation</p><ul><li>Create an Installation Script:<br> — Write a script to automate Joomla installation on EC2 instances.</li></ul><p>3. Set Up an Application Load Balancer (ALB)</p><ul><li>Create an ALB:<br> — Create an Application Load Balancer and configure it to distribute traffic across the EC2 instances.<br> — Associate the ALB with the appropriate subnets and security groups.</li></ul><p>4. Modify Security Groups:</p><ul><li>Update the EC2 instances’ security groups to only accept traffic from the ALB security group.</li></ul><p>5. Test the Load Balancer</p><ul><li>Verify Load Distribution:<br> — Test the ALB to ensure traffic is evenly distributed between the EC2 instances.<br> — Test failover and load distribution to ensure high availability.</li></ul><h4>Conclusion</h4><p>By implementing a two-tier architecture on AWS, Adventure Works can effectively manage increased traffic, ensure data security, and provide a seamless user experience. This scalable, secure, and highly available setup will support Adventure Works as they grow their clientele and expand their offerings.</p><h4>Benefits of Two-Tier Architecture for Adventure Works</h4><p>*Scalability: Independent scaling of web and database servers.<br>*Security: Enhanced security with isolated data storage.<br>*Manageability: Simplified maintenance and updates.<br>*Reliability: High availability and automated backups with RDS.</p><p>Follow these steps to create a robust and efficient cloud infrastructure for your own projects. Happy adventuring in the cloud!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=654d16d78383" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scaling New Heights: How to Leverage AWS CloudFormation for Seamless Growth!]]></title>
            <link>https://medium.com/@mrskeetonthe1/scaling-new-heights-how-aurora-digital-leveraged-aws-cloudformation-for-seamless-growth-fbea8188a03c?source=rss-694a3fb4bf91------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbea8188a03c</guid>
            <category><![CDATA[cloudformation]]></category>
            <dc:creator><![CDATA[Jessica Ross How I became a Cloud DevOps Engineer!]]></dc:creator>
            <pubDate>Tue, 30 Jul 2024 15:01:04 GMT</pubDate>
            <atom:updated>2024-07-30T15:17:55.022Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*YvHNkCeZOT6gEXb_N54Lhw.jpeg" /></figure><p><em>Aurora Digital, a booming online retailer specializing in luxury home goods, is experiencing unprecedented growth. To handle the increasing traffic and scale efficiently during major sales events, the company decided to transition its digital operations to AWS. This blog post will walk you through how Aurora Digital implemented a cloud-based infrastructure using AWS CloudFormation, focusing on scalability, automation, security, and cost-efficiency.</em></p><h4>Why CloudFormation?</h4><ul><li>Automation: Reduces human error and frees up developer time by automating the provisioning and management of a complex cloud environment.</li><li>Consistency: Ensures consistent environments are created every time, eliminating the “it works on my machine” problem.</li><li>Version Control: Allows infrastructure to be version-controlled and reviewed as part of application code.</li><li>Reusability: Enables reusing templates across the company, speeding up future deployments and ensuring best practices.</li></ul><h4>CloudFormation Setup:</h4><p>First, create a CloudFormation template to deploy an EC2 instance with an Apache webserver.</p><p>AWSTemplateFormatVersion: ‘2010–09–09’<br>Resources:<br> WebServerInstance:<br> Type: ‘AWS::EC2::Instance’<br> Properties: <br> InstanceType: ‘t2.micro’<br> ImageId: ‘ami-0c55b159cbfafe1f0’ # Update to the latest Amazon Linux 2 AMI ID<br> KeyName: ‘YourKeyName’ # Replace with your key name<br> SecurityGroups:<br> — !Ref WebServerSecurityGroup<br> UserData: <br> Fn::Base64: <br> !Sub |<br> #!/bin/bash<br> yum update -y<br> yum install -y httpd<br> systemctl start httpd<br> systemctl enable httpd<br> echo “Welcome to Aurora Digital!” &gt; /var/www/html/index.html</p><p>WebServerSecurityGroup:<br> Type: ‘AWS::EC2::SecurityGroup’<br> Properties:<br> GroupDescription: ‘Enable HTTP access’<br> SecurityGroupIngress:<br> — IpProtocol: ‘tcp’<br> FromPort: ‘80’<br> ToPort: ‘80’<br> CidrIp: ‘0.0.0.0/0’</p><h4>Deploy the CloudFormation Template</h4><ol><li>Go to the AWS Management Console.<br>2. Navigate to CloudFormation.<br>3. Click on “Create stack” and choose “Upload a template file.”<br>4. Upload your CloudFormation template and click “Next.”<br>5. Provide a stack name (e.g., “AuroraDigitalWebServer”).<br>6. Configure stack options as needed and click “Next.”<br>7. Review the settings and click “Create stack.”</li></ol><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>Update CloudFormation Template for Autoscaling</h4><p>Enhance the CloudFormation template to include an autoscaling group with Apache installed on each instance.</p><p>```yaml<br>AWSTemplateFormatVersion: ‘2010–09–09’<br>Resources:<br> LaunchConfiguration:<br> Type: ‘AWS::AutoScaling::LaunchConfiguration’<br> Properties: <br> InstanceType: ‘t2.micro’<br> ImageId: ‘ami-0c55b159cbfafe1f0’ # Update to the latest Amazon Linux 2 AMI ID<br> SecurityGroups:<br> — !Ref WebServerSecurityGroup<br> UserData: <br> Fn::Base64: <br> !Sub |<br> #!/bin/bash<br> yum update -y<br> yum install -y httpd<br> systemctl start httpd<br> systemctl enable httpd<br> echo “Welcome to Aurora Digital!” &gt; /var/www/html/index.html</p><p>AutoScalingGroup:<br> Type: ‘AWS::AutoScaling::AutoScalingGroup’<br> Properties:<br> VPCZoneIdentifier:<br> — !Ref PublicSubnet1<br> — !Ref PublicSubnet2<br> — !Ref PublicSubnet3<br> LaunchConfigurationName: !Ref LaunchConfiguration<br> MinSize: ‘2’<br> MaxSize: ‘5’<br> DesiredCapacity: ‘2’<br> TargetGroupARNs: <br> — !Ref TargetGroup</p><p>TargetGroup:<br> Type: ‘AWS::ElasticLoadBalancingV2::TargetGroup’<br> Properties:<br> HealthCheckPath: ‘/’<br> Port: 80<br> Protocol: HTTP<br> VpcId: !Ref VPC</p><p>LoadBalancer:<br> Type: ‘AWS::ElasticLoadBalancingV2::LoadBalancer’<br> Properties:<br> Subnets:<br> — !Ref PublicSubnet1<br> — !Ref PublicSubnet2<br> — !Ref PublicSubnet3<br> SecurityGroups:<br> — !Ref LoadBalancerSecurityGroup</p><p>LoadBalancerListener:<br> Type: ‘AWS::ElasticLoadBalancingV2::Listener’<br> Properties:<br> DefaultActions:<br> — Type: ‘forward’<br> TargetGroupArn: !Ref TargetGroup<br> LoadBalancerArn: !Ref LoadBalancer<br> Port: ‘80’<br> Protocol: ‘HTTP’</p><p>WebServerSecurityGroup:<br> Type: ‘AWS::EC2::SecurityGroup’<br> Properties:<br> GroupDescription: ‘Enable HTTP access from Load Balancer’<br> SecurityGroupIngress:<br> — IpProtocol: ‘tcp’<br> FromPort: ‘80’<br> ToPort: ‘80’<br> SourceSecurityGroupId: !Ref LoadBalancerSecurityGroup</p><p>LoadBalancerSecurityGroup:<br> Type: ‘AWS::EC2::SecurityGroup’<br> Properties:<br> GroupDescription: ‘Enable HTTP access’<br> SecurityGroupIngress:<br> — IpProtocol: ‘tcp’<br> FromPort: ‘80’<br> ToPort: ‘80’<br> CidrIp: ‘0.0.0.0/0’</p><p>PublicSubnet1:<br> Type: ‘AWS::EC2::Subnet’<br> Properties:<br> VpcId: !Ref VPC<br> CidrBlock: ‘10.0.1.0/24’<br> MapPublicIpOnLaunch: true</p><p>PublicSubnet2:<br> Type: ‘AWS::EC2::Subnet’<br> Properties:<br> VpcId: !Ref VPC<br> CidrBlock: ‘10.0.2.0/24’<br> MapPublicIpOnLaunch: true</p><p>PublicSubnet3:<br> Type: ‘AWS::EC2::Subnet’<br> Properties:<br> VpcId: !Ref VPC<br> CidrBlock: ‘10.0.3.0/24’<br> MapPublicIpOnLaunch: true</p><p>VPC:<br> Type: ‘AWS::EC2::VPC’<br> Properties:<br> CidrBlock: ‘10.0.0.0/16’<br> EnableDnsSupport: true<br> EnableDnsHostnames: true<br> InstanceTenancy: ‘default’<br>```</p><h4>Deploy the Enhanced CloudFormation Template</h4><p>1. Go to the AWS Management Console.<br>2. Navigate to CloudFormation.<br>3. Click on “Create stack” and choose “Upload a template file.”<br>4. Upload your enhanced CloudFormation template and click “Next.”<br>5. Provide a stack name (e.g., “AuroraDigitalAutoScaling”).<br>6. Configure stack options as needed and click “Next.”<br>7. Review the settings and click “Create stack.”</p><h4>Verify Your Setup</h4><p>After the stack creation is complete, verify that the resources have been successfully deployed:</p><p>1. Obtain the DNS name of the Load Balancer from the CloudFormation outputs.<br>2. Open the DNS name in a web browser.<br>3. You should see the “Welcome to Aurora Digital!” page.</p><h4>Conclusion</h4><p>By leveraging AWS CloudFormation, Aurora Digital has successfully implemented a scalable, reliable, and secure cloud-based infrastructure. This setup ensures the platform can handle increasing traffic, particularly during peak sales events, without compromising performance or security. Furthermore, the automation and cost-efficiency of AWS CloudFormation enable Aurora Digital to focus on delivering exceptional luxury home goods to their customers.</p><p>— -</p><p>Follow these steps to ensure a smooth transition to AWS and take full advantage of CloudFormation’s capabilities for your own projects. Happy deploying!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbea8188a03c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>