<?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 Alexus R. on Medium]]></title>
        <description><![CDATA[Stories by Alexus R. on Medium]]></description>
        <link>https://medium.com/@alexusrozier?source=rss-13ec7bf3bed4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7F-FEKUscnl5ii7Lr40H_A.jpeg</url>
            <title>Stories by Alexus R. on Medium</title>
            <link>https://medium.com/@alexusrozier?source=rss-13ec7bf3bed4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 07:36:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alexusrozier/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[Installing Jenkins on AWS EC2 Instance using Terraform]]></title>
            <link>https://medium.com/@alexusrozier/installing-jenkins-on-aws-ec2-instance-using-terraform-cc1f98bbdfbc?source=rss-13ec7bf3bed4------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc1f98bbdfbc</guid>
            <dc:creator><![CDATA[Alexus R.]]></dc:creator>
            <pubDate>Mon, 13 Mar 2023 01:47:57 GMT</pubDate>
            <atom:updated>2023-03-13T04:24:56.420Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*KZpCZTbahUgmBiRha4GoJQ.png" /><figcaption>Image Courtesy of: <a href="https://www.teepublic.com/pin/10501273-jenkins-at-your-service">https://www.teepublic.com/pin/10501273-jenkins-at-your-service</a></figcaption></figure><p>Hello There and Welcome. This article is intended to demonstrate how to create an EC2 instance that installs Jenkins server utilizing Terraform to do so. This Project was simply complicated for me. However, if I didn&#39;t learn anything else, I learned this. PAY ATTENTION to what the errors are saying. No like really, What did the error say? Okay, then you troubleshoot from there.</p><p>So before I embarked on this project, I wanted to know the importance of utilizing a Jenkins server in the cloud environment. From what I have read and come to understand, most organizations utilize Jenkins to automate and speed up the software development process. It incorporates a variety of development life-cycle operations, such as build, document, test, package, stage, deploy, static analysis, and more. Being from an Operations background, I understand and can definitely appreciate automation and quick deployment as operational efficiency and expeditious delivery to the customer is a must.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/0*sNS5ItPzFHY0BQIo" /></figure><p>Okay, we are going to get right into this one. So first, let’s take a look and ensure we have all the prerequisites.</p><p>Pre-reqs:</p><p>· AWS account ( I utilized AWS Cloud9 Platform to execute the Meat and Potatoes of this project)</p><p>· Working Knowledge of Terraform and basic workflow commands</p><p>· Attention to detail ( #Syntaxmatters)</p><p>Alright, as I stated, let’s get right into it.</p><p>Desired Outcome:</p><p>&gt; Deploy 1 EC2 Instances in your Default VPC.</p><p>&gt; Bootstrap the EC2 instance with a script that will install and start Jenkins.</p><p>&gt; Create and assign a Security Group to the Jenkins Security Group that allows traffic on port 22 from your ip and allows traffic from port 8080.</p><p>&gt;Create a S3 bucket for your Jenkins Artifacts that is not open to the public.</p><p>I started out by logging to the AWS Console and navigating over to the AWS Cloud9 Platform. (Once there, I opened my Terraform Environment that I’d created previously). Follow this link to learn how to do this, if you haven’t already. <a href="https://developer.hashicorp.com/terraform/tutorials/aws-get-started/aws-build">https://developer.hashicorp.com/terraform/tutorials/aws-get-started/aws-build</a>.</p><p>Alright so here we go:</p><p>STEP 1:</p><p>Once inside your environment. Create your directory that you will create your file in to make the magic happen. Then cd into said directory.</p><pre>mkdir &lt;directory name&gt;<br><br>cd &lt;directory name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*sk29vhFMX2X483hqzQRKlw.png" /></figure><p>STEP 2:</p><p>Create the main.tf file. that of which is extremely instrumental to Terraform as it contains the main set of configuration for your module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/1*Pymd2aHlRVkrltM5gVKV9w.png" /><figcaption>As you can see mine says Main2.tf, I had to start over a time or two. Used main.tf as a reference</figcaption></figure><p>Step 3:</p><p>Now, once inside the main.tf, include all necessary configurations for the AWS provider. Those of which can be found here: d<a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs">ocs overview | hashicorp/aws | Terraform Registry</a>. I have included a screenshot of my main.tf file below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*6QaOo0z3Aut35HJGaEqdZg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*Aa_pBIkk0KVCDEEnoyC5OQ.png" /></figure><p>As you can see, I have created my EC2 instance with bash script to install Jenkins. Locating the appropriate configurations was rather easy as I utilized the Hashicorp Terraform registry for all of my configuration needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*jlgOAPTLM6KikcAzOy0BRw.png" /></figure><p>I was also able to create my S3 bucket for storage purposes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*GxAWvGSLDOped9cp3sGqww.png" /></figure><p>STEP 4:</p><p>Now that all the fun stuff has been created, we can move on to the good stuff. So, in our terminal, let’s enter the below:</p><pre>terraform init</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*275GeqtEBYUHh0phB_sHNg.png" /></figure><p>Step 5:</p><p>Next we will validate that everything is as it should be from a configuration and syntax/argument standpoint.</p><pre>terraform validate</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*aO99sHOpqQrtYRKJJf_6cQ.png" /></figure><p>Step 6:</p><p>Next we will plan all that we have indicated that we want to take place within our configuration.</p><pre>terraform plan</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dJOh7JN3s56uFdyrqa-vQQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*IrJ6mDgdRyxpY3HHU5I3jQ.png" /></figure><p>Step 7:</p><p>And lastly, we will do the final step to trigger all the magic to happen.</p><pre>terraform apply</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cfO7hjWQ2-1veLzITIAl3A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*JYdRmYcuHWOQnnpoRCwBOQ.png" /></figure><p>YESSSSSSS!!!!! We are done…(Bloopers at the end…this did not come without interruptions.)</p><p>Step 8:</p><p>Let’s make sure we destroy all the fun stuff before we close up shop.</p><pre>terraform destroy</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*H5jp5K4Z5OOUcR610OBteA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*P9aI3sXFqsWXaNUToJ4fzw.png" /></figure><p>Oh, I have Receipts :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*WbpBl0ZfzTTvM4vZvgJ-FA.png" /><figcaption>Newly created EC2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hA29bbAjDYAlHNQp3R4Ewg.png" /><figcaption>Newly created Security Group</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*pSh5S4nJ90d40rqPzju_5g.png" /><figcaption>Newly created S3bucket</figcaption></figure><p>And now for the Bloopers:</p><p>E1:Had an issue with Subnets</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*eJLjSDbq694aPTcfPDouwA.png" /></figure><p>Solution: Turns out my default VPC did not have a subnet setup. Which led me to believe I could just go add one. Absolutely not. Turns out I had to delete it and create a new default VPC. Used this link.<a href="https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html">https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html</a></p><p>E2: Something about an argument</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*C6BtePzaCZN0iEB6boRROQ.png" /></figure><p>Solution: While trying to solve one issue, I created another. Deleted a bracket or two by accident. I had to Teams message a friend on this one. Needed a fresh set of capable eyes. Once I returned them to their rightful place. A successful validation let me know I was back on track.</p><p>Honestly, this project was a growth project. I possessed all the skill needed to execute the deliverables, however, anxiety crept in. But my confidence said, No No…Not today. We got this. And I was able to see it through. So just remember that the next time you find yourself in what seems to be an unconquerable situation, it’s just anxiety and doubt talking, you got this! Now go code, deploy, troubleshoot, or whatever it is that you dominate. But do it like a Boss. Because that. YOU ARE!</p><p>Thank you for joining me…If you would like to tag along for more content, just click the follow button above. And have yourself an amazing rest of your day…week if you need it. Until next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc1f98bbdfbc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes… Deployments…ConfigMaps…Images…Custom HTML pages..at your Service]]></title>
            <link>https://medium.com/@alexusrozier/kubernetes-deployments-configmaps-images-custom-html-pages-at-your-service-2598e5d26865?source=rss-13ec7bf3bed4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2598e5d26865</guid>
            <dc:creator><![CDATA[Alexus R.]]></dc:creator>
            <pubDate>Mon, 06 Mar 2023 22:38:02 GMT</pubDate>
            <atom:updated>2023-03-06T22:38:02.668Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wcFnCtLpPZHLzgvBtvB9-w.jpeg" /></figure><p>Hello There and Welcome. This article is intended to demonstrate how to build multiple deployments within Kubernetes that run the Nginx image with two pods that point to a customized html page.</p><p>Okay, we are going to get right into this one.</p><p>Pre-reqs:</p><p>· Cloud Server (Kubernetes package installed 😊. I utilized Cloud Playground on A Cloud Guru)</p><p>· A CLI (I utilized Windows Command Prompt)</p><p>· PATIENCE, PATIENCE, PATIENCE</p><p>Desired Outcome:</p><p>· Create 2 Deployments (Each containing 2 pods that both run the nginx image)</p><p>· Each deployment will need to contain a Configmap as well (total of two are to be created)</p><p>· Both Configmaps will need to point to custom html pages</p><p>· A Service will need to be created that points to both deployments as well</p><p>Disclaimer:</p><p>Dear Reader,</p><p>This project is more about resilience, perseverance, and teamwork than it is the actual project. Don’t get me wrong, delivering a successful completion of a project is ideal, however, things are not always as seamless as we would hope. When I tell you that it took me days to overcome HURDLE after HURDLE after HURDLE. Life lessons were learned during this project phase. And I can’t be more appreciative of the process.</p><p>(Hint: before you get started, be sure you have ssh’d into your cloud environment. Again, I used A Cloud Guru’s playground. Wonderful option if I must say so myself. Made the process seamless)</p><p>Step 1: Create Configmap prior to Deployment</p><p>Okay, so I started out with simply creating my Configuration Map. See the below screenshot of the vim file I created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*616bfxTciDJsR-A7_qBLfA.png" /></figure><p>Next, we will need to apply what we just created.</p><pre>sudo kubectl apply -f &lt;file name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*Jqn7YpDxSpLmL7JT8mcPew.png" /></figure><p>Alright, now that that’s done, we can move on.</p><p>Step 2: Create Deployment 1</p><p>Next, I prepared to create the actual deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*bPkdJScF51DkVXZ9rF1O5w.png" /></figure><p>Next let’s run the below command to check on our deployment.</p><pre>kubectl get deployments </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*d61BxC_7z3HfsKNNbxtcDQ.png" /></figure><pre>kubectl get pods</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*LNgIUZh2wTKaRYP2LZy-4g.png" /></figure><p>Next, we will need to create a service in order to communicate with our cluster.</p><p>Step 3: Create a Service (for Deployment 1)</p><p>From the command line, we can enter the below for a much quicker way to execute this task.</p><pre>cat &lt;&lt; EOF | kubectl apply -f -</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*lji5Sw2Efiix8dseywoUUA.png" /></figure><p>Then we will expose the service to ensure that it can be properly reached.</p><p>Next we will create and expose the NodePort.</p><pre>kubectl expose deployment&lt;deployment name&gt; --type=&quot;NodePort&quot; --port=80</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*4Aktg5CB2VSWwKRKtFZkIA.png" /><figcaption>You may notice that this screen shot points to “awr-deploy2”, yep I accidently deleted my screenshot of awr-deploy1. Luckily I had this one to utilize as an example. Alrighty, moving on. :-)</figcaption></figure><pre>kubectl get services</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*2g6E-hVk9B60u5cO1dAMew.png" /></figure><p>Alright, let’s see if it worked…..</p><p>Step 4: Reveal custom HTML page</p><pre>curl &lt;deployment IP address&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*ci6d-P7Jja48EyKXA5XLJQ.png" /></figure><p>IT WORKED!!! Now we just have to repeat the process for Deployment 2.</p><p>So in the process of playing around with a few things, I discovered a very efficient way to complete this project that worked quite well for me. And let me just say, I could not have been happier. I will be pasting the screenshots below. Follow along if you will. :-)</p><p>Creating ConfigMap for Deployment 2</p><pre>cat &lt;&lt; EOF | kubectl apply -f -</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tkjCNgMrriP6Jti5NXzNHg.png" /></figure><p>Next lets create our 2nd deployment:</p><pre>cat &lt;&lt; EOF | kubectl apply -f -</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8eVTz71k_sLiiH1mZNKG1w.png" /></figure><p>Alright, we got that created, let’s keep the ball rolling.</p><pre>kubectl get deployments</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*reazIXg0CoKgsE4Vk1vXkQ.png" /></figure><pre>kubectl get pods</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*hxmte86sPgGi1JLnNrPS5w.png" /></figure><p>Next we will create our second service.</p><pre>cat &lt;&lt; EOF | kubectl apply -f -</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*AwaJk0RtDpr_T8XvjOyETQ.png" /></figure><p>Next we will create and expose the NodePort.</p><pre>kubectl expose deployment&lt;deployment name&gt; --type=&quot;NodePort&quot; --port=80</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*4Aktg5CB2VSWwKRKtFZkIA.png" /></figure><p>Then we will ‘kubectl get service’ again to get our IP address for the second deployment</p><pre>kubectl get services</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gm-bm6ehQ6V_MSaln19eeg.png" /></figure><p>Alright now…the time that I have been waiting for…does it work? (It should. The 2nd go around felt so much smoother.)</p><pre>curl &lt;IP address&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sroYl9GHWiHVzTikbtHQ_A.png" /></figure><p>Yes!!!!! It worked. I’m so happy this worked. Now I can mark this lesson as complete and move on. I hope that you were successful on your end if you were following along with me. If not, and you do happen to give this a go on one of these fine days, be sure you have packed your patience. For some reason, this project pulled out the GRIT in me, but I got to it and I prevailed.</p><p>If you would like to tag along for the remainder of my journey through this process, just click the follow button above. Thank you for joining me. Have an amazing rest of your day!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2598e5d26865" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Deployment using Kubernetes that runs an Nginx Image]]></title>
            <link>https://medium.com/@alexusrozier/build-a-deployment-using-kubernetes-that-runs-an-nginx-image-529c44bce87d?source=rss-13ec7bf3bed4------2</link>
            <guid isPermaLink="false">https://medium.com/p/529c44bce87d</guid>
            <dc:creator><![CDATA[Alexus R.]]></dc:creator>
            <pubDate>Sat, 04 Feb 2023 19:12:00 GMT</pubDate>
            <atom:updated>2023-02-04T19:12:00.273Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IKAKVzqmIzKjlksyVAevvw.jpeg" /></figure><p>Hi There and Welcome. Today’s demonstration will focus on how to build a deployment that will run an Nginx image. Now after days of trial and error and much perseverance, I was able to successfully complete this project.</p><p>A little more to know about the rolling update is that it uses a readiness probe to check if a new pod is ready, before starting to scale down pods with the old version. If an issue is incurred, you can stop the update and roll it back, without stopping the entire cluster.</p><p>To perform a rolling update, simply update the image of your pods using kubectl set image. This will automatically trigger a rolling update. We will do so below. So let’s get started.</p><p>Desired Outcome of the Project:</p><p>· Create a deployment that runs the nginx image(Using CLI)</p><p>· Display the details of this deployment</p><p>· Check the Event Logs from the deployment</p><p>· Delete deployment</p><p>PreReqs:</p><p>· IDE of your choice (I used AWS’ Cloud 9). (An AWS Account is required if this is your choice)</p><p>· Established Kubernetes Cluster</p><p>· Patience…patience..and a little more patience. ( At least this is what was required to set up the Cluster :-) There were bugs every where..however, research and tencacity goes a loooooooong way)</p><p>Step 1: Create a deployment</p><p>Let’s begin by entering the below command into your CLI.</p><pre>kubectl create deployment nginx-web --image=nginx</pre><pre>kubectl create deployment perseverance –image=nginx</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ri-mlBB-u5rNUkaiz8epNg.png" /><figcaption>Output should show deployment created</figcaption></figure><p>I just want to ensure that the deployment was actually created. So I entered the below command.</p><pre>kubectl get deployment</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*96tK19cmmXxUrmoP57I00Q.png" /><figcaption>And there it is, Perseverance. Yes, I named my deployment perseverance. LOL!</figcaption></figure><p>Next, we will need to retrieve the details of our deployment. Enter the below to execute this task.</p><p>Step 2: Display the details of this deployment</p><pre>kubectl describe deployment &lt;deployment name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*d3RaCHSMmv99j30u9mH6Yw.png" /></figure><p>Alright, it’s looking good so far. Almost to the end. Next lets check out logs.</p><p>Step 3: Check the Event Logs from the deployment</p><pre>kubectl get events</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*AeBVWc8p53ws96FZtxAXtQ.png" /></figure><p>Alright, so from the looks of things…All was successful. Hoping the same for you. Finally, let’s ensure we delete the deployment.</p><p>Step 4: Delete Deployment</p><pre>kubectl delete deployment &lt;deployment name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*NePzeuWhHz2bd8HKITF_vg.png" /></figure><p>And that is it. Congratulations 🎊!!!!.We are done. I hope that you were able to reach your desired outcome. Another in the books. I must say, we are getting good at this. When I say this project pushed me, it PUSHED me. (It was really a pre-req: the cluster creation, it was a true challenge. But I overcame.) The best part of this project was deleting the deployment. It just felt like success. It’s the little wins nowadays. Anywho, thank you for joining me. Until next time. Best</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=529c44bce87d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Docker NGINX Image]]></title>
            <link>https://medium.com/@alexusrozier/creating-a-docker-nginx-image-c16eff9291e1?source=rss-13ec7bf3bed4------2</link>
            <guid isPermaLink="false">https://medium.com/p/c16eff9291e1</guid>
            <dc:creator><![CDATA[Alexus R.]]></dc:creator>
            <pubDate>Sun, 22 Jan 2023 09:21:17 GMT</pubDate>
            <atom:updated>2023-01-22T09:21:17.154Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*ssAxXWRTw8LCVPrY_OrQBg.png" /></figure><p><strong><em>Desired Outcomes for this Project:</em></strong></p><p>1. Create your own image using Nginx and add a file that will tell you the date the container has been deployed</p><p>2. Deploy your container with port 8080 open</p><p>3. Save your container data to the AWS Elastic Container Registry (ECR)</p><p><strong><em>Pre-reqs:</em></strong></p><ul><li>AWS IAM user with Administrator Access</li><li>IDE of your choice (I will be using AWSCloud9).</li></ul><p>Alright, now for the fun stuff.</p><p>We will begin by loggin into our IDE, again that is Cloud9 for me, may be VSCode for others. However, it should all yield the same desired outcome. Once logged in, let’s head on over to our terminal within our environment.</p><h4>1) Create a Directory</h4><p>First, we will need to create a directory where the HTML and Docker file can be stored. We will use the below commands to do so. We also need to cd into the directory so that we are able to perform the desired function.</p><pre>mkdir &lt;DIRECTORY NAME&gt;<br>cd &lt;DIRECTORY NAME&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*3D2L0Db0FFAhATsG2JZPOw.png" /><figcaption>Output should look like the above</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CtP_skdk2cu46S2WqXECnQ.png" /><figcaption>If your screen appears as the above then we are on the right track</figcaption></figure><p>Now, for the image retrieval.</p><h4>2) Retrieve Image from Registry</h4><p>Next, we will pull the latest version of Nginx from the Docker registry. Enter the below command in your Terminal.</p><pre>docker pull nginx</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XgKGT6VpAKXzBQ4wbDqc-w.png" /></figure><p>As you can see from the image above, the pull was a success — however, lets verify that we pulled the latest image. Use the below command to do so.</p><pre>docker images </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*zxRElC2ALPk8KQqe5Wye-g.png" /></figure><p>Okay, now that we have our desired retrieval complete, we can move on.</p><h4>3) Create Docker and HTML file</h4><p>Inside the terminal, we need to do the following:</p><p>Create Docker file using the below command:</p><pre>touch Dockerfile</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*ya7W-oFYjhYXGFSKsQNa1w.png" /></figure><p>Then, you will see I also used the <em>ls command</em> to ensure file was created.</p><p>While we are at it, let’s just add a little something to the file for pizazz. Enter the below script into your file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*Qy-pP0ztKMAfGbkudyAPIQ.png" /><figcaption>HInt: Vim into the file to edit. Then save and exit.</figcaption></figure><p>After the Docker file is created, we will create our html file.</p><pre>touch index.html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*LIRZbypZqftnTrMllGmF_A.png" /></figure><p>Be sure to <em>ls command</em> to ensure file was created. Then we can add some fun script to make things a little more interesting.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>    &lt;body style=&quot;background-color:rgb(49, 214, 220);&quot;&gt;&lt;center&gt;<br>    &lt;head&gt;<br>        &lt;title&gt;WHALE HELLO THERE!!&lt;/title&gt;<br>    &lt;/head&gt;<br>    &lt;body&gt;<br>        &lt;h1&gt;Hello!! This is the current date &amp; time : <br>        &lt;p&gt;&lt;span id=&quot;datetime&quot;&gt;&lt;/span&gt;&lt;/p&gt;<br>        &lt;script&gt;<br>            var dt = new Date();<br>            document.getElementById(&quot;datetime&quot;).innerHTML = dt.toLocaleString();<br>        &lt;/script&gt;<br>        &lt;/h1&gt;<br>    &lt;/body&gt;<br>    <br>&lt;/html&gt;</pre><p>Next, we will move on to create our image.</p><h4>4) Build Image from Dockerfile</h4><p>We will need to enter the below command into the terminal to execute this task: (which creates a container first)</p><pre>docker run -d — name nginx -p 8080:80 nginx </pre><p>Ok, so full transparency, my first output came out, in the words of Mrs. Tabitha Brown, ‘Like so, Like that.’ …see below output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*GjMZ0eZwiWwzGqFJj9JkEQ.png" /><figcaption>This is not the desired output. I checked my syntax and tried it again.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*v2VZ87hLfBwmFSTFbxgT1A.png" /><figcaption>Your output should look like the above. #Syntax matters</figcaption></figure><p>Next we will enter the below command to see the status of our process.</p><pre>docker ps</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wUsWjWyFIPofcJlyCOvuOw.png" /></figure><p>Now for PMP: (Peace of Mind Purposes), Let’s verify that our container has internet access. Enter the below command.</p><pre>curl localhost:8080</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*G9x-Sz0ugmoIetNpek9kXg.png" /></figure><p>Now for verification of the image and creation date:</p><pre>docker inspect nginx | grep -i created &gt; created.txt and<br><br>cat created.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*VKrK7450o0yfz6Vt3Sl-_A.png" /></figure><h4>5) Save &amp; Push Container Data to AWS ECR</h4><p>To push the data to AWS ECR, we must first create a repository. Use the following command to initialize a new repository:</p><pre>aws ecr create-repository --repository-name docker-nginx --region us-east-1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*zvHfjCqFBVooJ2PAvtw_Ew.png" /></figure><p>Let’s confirm the creation of our repository, by checking in the AWS Repositories Console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*--hCIpUO7ZL-iFGU-JNSbg.png" /></figure><p>Still while within the console, <strong><em>Select </em></strong><em>your </em><strong><em>repo </em></strong><em>and</em><strong><em> click</em></strong><em> on the </em><strong><em>‘View Push Commands’.</em></strong></p><p>Hint: Window should populate that is similar to the below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*OriLE3HaVSFsMiVcZWQWVg.png" /></figure><p>Of the commands listed(there are 4 options), Number 1. should be copied and pasted into your CLI terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*TE8zYvi7KYbrcrK_lrl1Qw.png" /></figure><p>Login was a success!</p><p>Next, we will tag our image so it can be pushed to our ECR repository. We will do so by copying and pasting( Number 3.) from the above referenced command options.</p><pre>docker tag &lt;Image Name&gt; &lt;ECR Repository URI&gt;docker tag nginx16 &lt;ECR Repository URI&gt;</pre><p>Use the following command to push the Docker image:</p><pre>docker push &lt;ECR Repository URI&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*PcfQ7yRl7O9W1qmmusTVPw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*4Nav1IwGEgd6A3HmtYBtoA.png" /></figure><p>Congratulations! We just created a Docker NGINX image and pushed it to Amazon ECR. I don’t know about you, but this one was interesting. Now for some light housekeeping.</p><p>Note: Please <strong>remove </strong>the <strong>container</strong> and <strong>images</strong> in the terminal using the following commands:</p><pre>For containers: docker rm -f $(docker ps -a -q)<br>For images: docker rm -f $(docker images -q)</pre><p>Again, I hope you enjoyed this tutorial. If you did, give me a hand or two. Now put them together. See a little hand clap won’t hurt. Lol. And if you would like to tag a long for the remainder of my journey, just click the follow button above. Thank you for joining me. Until next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c16eff9291e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Triggering a Lambda Function to Send a Message to SQS via Python]]></title>
            <link>https://medium.com/@alexusrozier/triggering-a-lambda-function-to-send-a-message-to-sqs-via-python-2d5e58aa5579?source=rss-13ec7bf3bed4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d5e58aa5579</guid>
            <dc:creator><![CDATA[Alexus R.]]></dc:creator>
            <pubDate>Mon, 16 Jan 2023 01:51:19 GMT</pubDate>
            <atom:updated>2023-01-16T01:51:19.517Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*4UcZWJoCz59GsiAUTs1v7Q.png" /></figure><p><strong><em>Desired Outcome for this Project:</em></strong></p><ol><li>Create a Standard SQS Queue using Python.</li><li>Create a Lambda function in the console with a Python 3.7 or higher runtime</li><li>Modify the Lambda to send a message to the SQS queue. Your message should contain either the current time or a random number. You can use the built-in test function for testing.</li><li>Create an API gateway HTTP API type trigger.</li><li>Test the trigger to verify the message was sent.</li></ol><p><strong><em>Pre-reqs:</em></strong></p><ul><li>AWS IAM user with Administrator Access</li><li>IDE of your choice (I will be using AWSCloud9), I have already configured the IDE with the following: Boto3, AWS CLI. (See below command to ensure you are set up as well)</li></ul><pre>pip3 install awscli<br>pip3 install boto3</pre><pre>#Create a Standard SQS Queue using Python<br><br>import boto3<br><br># Obtain the service resource<br>sqs = boto3.resource(&#39;sqs&#39;)<br><br># Queue will be created &amp; output will returns an SQS Queue instance<br>queue = sqs.create_queue(QueueName=&#39;1stQueue&#39;)<br><br>print(queue.url)</pre><h3>1) Create a Standard SQS Queue using Python</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*4Ubl-3tQuIlWct6GJLpbaQ.png" /><figcaption>(Note: Where ‘1stQueue’ is listed, this can be a queue name of your choice)</figcaption></figure><p>We can verify that the SQS Queue was created by navigating to AWS console to ‘Amazon SQS’ and you’ll see the newly created queue:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cIcZkDxs25-05b-JROEy5w.png" /></figure><h3>2) Create a Lambda Function</h3><p>Okay so let’s create our Lambda function that will send a message to the SQS queue we just created.</p><p>In the AWS console, navigate to <strong>Lambda</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*2JSxHZYFoksr8nkZk2FnrA.png" /></figure><ul><li>Select ‘<strong><em>Create function’</em></strong></li><li>Select ‘<strong><em>Author from scratch’</em></strong></li><li>Name your function</li><li>Select Python 3.8 from <em>Runtime</em></li><li>Leave everything else default and Click ‘<strong><em>Create a function’</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xhhy5rv_RIvJ_1h8A6zYZA.png" /></figure><p>Once the Lambda function has successfully been created:</p><ul><li><strong>Click</strong> on ‘<strong><em>Configuration’</em></strong></li><li><strong><em>Then Click</em></strong><em> ‘</em><strong><em>Permissions’</em></strong></li><li><strong>Click </strong>the newly created ‘IAM role‘.’</li></ul><p>Why is that? Glad you asked. We need to update it. Alright so by clicking the role name as shown below, we will be able to update the permissions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wYOi1MtiIllgpWb4Mnxe5w.png" /></figure><ul><li>In the IAM console, C<strong>lick ‘<em>Add Permissions’</em></strong>, <strong><em>Attach policies </em></strong>and search “SQS” and select the appropriate policy and <strong><em>Attach policies</em></strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*672pX4euGQ-DihTmyyjmfw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WdlXDqifi1uhMJ2cEms6KQ.png" /><figcaption>(Note: For the purpose of this project, select AmazonSQSFullAccess, otherwise, choose the option that best fits your needs )</figcaption></figure><p>Visibility of the following should be available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zHWpY7-SkFUP-jRTX8NjKQ.png" /></figure><h3>3) Modify Lambda to send a message to the SQS queue</h3><p>Next we will navigate back to our <strong>AWS Lambda </strong>screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Muq9pvoaqfPsFfV3AEumcQ.png" /></figure><p>In <strong>Lambda</strong>, Click ‘<strong><em>Code’</em></strong><em> </em>and use the B<strong>elow Code</strong> to modify the existing Lambda function. Why are we doing this? Glad you asked. This will send a message to SQS regarding the current time.</p><pre>import json<br>import boto3<br><br>from datetime import datetime<br><br>def lambda_handler(event, context):<br> <br>    now = datetime.now()<br>    time_date = now.strftime(&quot;%H:%M:%S %m/%d/%Y&quot;)<br><br>    sqs = boto3.client(&#39;sqs&#39;)<br>    <br>    sqs.send_message(QueueUrl=&quot;https://sqs.us-east-1.amazonaws.com/XXXXXXXXX/test-queue-name&quot;,MessageBody=time_date)<br>    <br>    return {<br>        &#39;statusCode&#39;: 200,<br>        &#39;body&#39;: json.dumps(&#39;Processed&#39;)<br>    }</pre><p><em>(Note: Under the sqs.send message line. I made the following modification: </em><a href="https://sqs.us-east-1.amazonaws.com/295929514202/1stQueue">https://sqs.us-east-1.amazonaws.com/295929514202/1stQueue</a>. <em>I included the URL of the SQS queue created in Step 1. (Target ARN). (See below)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R711upwU33ycIZzLSAUU1w.png" /></figure><ul><li>Click <strong><em>Deploy</em></strong> to save all changes</li><li>Then, Click <strong><em>Test </em></strong>to configure a test event:</li></ul><p>(Note: You will see the below window pop-up)</p><ul><li>Select the options as shown below:</li><li>Create new event</li><li>Enter a name your event. (I chose: Lex_LambdaTest)</li><li>Under Event Sharing Settings: Private was selected for demo purposes</li><li>Template- Select apigateway-aws-proxy</li><li>Then, Click <strong><em>Save </em></strong>to configure a test event:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*uztQ19C9131a4Aq5VpXPxg.png" /></figure><ul><li>Once you click <strong><em>Save. (</em></strong><em>You should get</em><strong><em> </em></strong><em>the much revered green bar)</em><strong><em>. Then Click the Test </em></strong><em>button</em><strong><em>. </em></strong>Once you click <strong>Test</strong>, you should see a window populate that is similar to the following:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_YQiKubWle2SooRbsz2amQ.png" /></figure><h3>4) Configure API Gateway Trigger for Lambda Function</h3><p>Now let’s create our trigger to get things moving.</p><ul><li>While on the <strong>AWS Lambda </strong>screen, select ‘<strong>Add trigger’</strong> as shown below.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_41bgE1zyjUlg6YQfyBwbg.png" /></figure><ul><li>Select <strong>API Gateway</strong> trigger from the dropdown menu and then configure the following:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EBQFnpAn-grKIIATB38lMQ.png" /></figure><p>Next, we will make the below selections to get the trigger completely set up.</p><ul><li>Intent: Create a new API</li><li>API Type: HTTP API</li><li>Security: Open</li><li>Additional Settings: Enter API name: (ie: LexFunction-API) &amp; Deployment stage: default</li><li>No other selections are necessary at this time. Then, click <strong>Add</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*gmkR-skh6ujFnKtljEsLbA.png" /></figure><h3>5) Test trigger &amp; Verify message was sent successfully</h3><p>Here we will need to add the appropriate permission for our API Gateway to communicate with our Lambda function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NRSUMre3Znkk9BjXGeWFwQ.png" /></figure><ul><li>Click ‘<strong><em>Configuration’</em></strong></li><li><strong><em>Click ‘Permissions’</em></strong></li><li>Click ‘<strong><em>Role Name’</em></strong></li><li><strong><em>Add ‘Permissions’</em></strong></li><li><strong><em>‘Attach Policy’</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kP9pfhm7TVdj36cD45EOmA.png" /></figure><ul><li>Search for ‘<strong>AmazonAPIGatewayAdmin</strong>’</li><li>Then, <strong>Select </strong>the Policy Name as demonstrated below.</li><li>Finally, Click <strong>Attach policies</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mUUSkBlMkRlDHpmc9cXFgQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K95j-qHyb-2qpbU8eB0k0A.png" /></figure><p>Now let’s navigate back to the <strong>AWS</strong> <strong>Lambda .</strong></p><ul><li>Make the below selections:</li><li><strong>Click</strong> Configurations</li><li>Then <strong>Click </strong>Triggers.</li><li>Finally, <strong>Click </strong>the<strong> </strong>API Endpoint URL.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*2g6cga6yUdY1d5mY5tuP0g.png" /></figure><p>Once you click the <strong><em>API Endpoint</em></strong> <strong><em>URL</em></strong> and you will see a new window open that says “<strong>Processed.”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*HPSmuW4acodTRvpejmMTtQ.png" /></figure><p>Navigating back to Amazon SQS window, you should see the below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Al9P1ytCtRBFLSQk9WgONw.png" /></figure><p>Note: The date &amp; time in which the API Endpoint was created will appear in the SQS queue</p><ul><li>Next, <strong>Click</strong> Send and Receive messages, in the top right corner.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ta-TmnoiJ80lumXSPQiuFg.png" /></figure><ul><li>Under the Receive Messages tab, <strong>Click ‘</strong><em>Poll for messages’</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GdsppvkEidtc7SN3M4a5ZA.png" /></figure><p>It may take a moment or two. But once complete, you should see a result similar to the below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3PQvEuuD_Svnowgig2A78A.png" /></figure><p>Alright, now we can verify the date &amp; time in which the message was sent:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*50a3nociPAw9VdumAJyQ-w.png" /></figure><p>Congratulations 🎊!!!! You made it to the end. You’ve successfully configured an API Gateway that triggers a Lambda function and sends messages to SQS via Python! Alright, now if this process was a lil shaky, there is nothing like a little more practice to get you comfortable and more familiar in the cloud and with its functions. I hope that you were able to reach your desired outcome. Thank you for joining me. Until next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d5e58aa5579" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a CI/CD Pipeline via AWS to automate the deployment of a Static Website]]></title>
            <link>https://medium.com/@alexusrozier/creating-a-ci-cd-pipeline-via-aws-to-automate-the-deployment-of-a-static-website-c24f0ceaaef0?source=rss-13ec7bf3bed4------2</link>
            <guid isPermaLink="false">https://medium.com/p/c24f0ceaaef0</guid>
            <dc:creator><![CDATA[Alexus R.]]></dc:creator>
            <pubDate>Tue, 13 Dec 2022 18:48:38 GMT</pubDate>
            <atom:updated>2022-12-13T18:48:38.301Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*kr0blqKlBdKTP1yAydA3TA.png" /></figure><p>This article will cover the steps taken to execute a project whose aims are to automate the deployment of a static website. After gaining a better understanding of Continuous Integration and Continuous Delivery and Continuous Deployment (CI/CD) I figured this would be quite interesting. Considering the bulk of my experience is in Third-Party Logistics and Operations Management, I know a thing or two about deployment and how it is important to have an automated process versus a manual one. When you are dealing with EDI (Electronic Data Interchange) as your primary source of workflow, the Management System used matters. *Primarily SAP based ERP (Enterprise Resource Planning), but I digress.) The automation of this system matters even more. However, if there is a glitch anywhere in the system, it could cause a major bottleneck in the pipeline, thus bringing operations to a screeching halt. Downtime means revenue loss in one area, and increased labor costs in another. The solution, find the source. Circling back around to CI/CD. If we can fix the first issue with smoother delivery and deployment, then we are back in business. Clean code helps as well. 😊 Okay so let’s get started.</p><p>For this project, the below goals need fulfilment:</p><p>§ Create a new repository in Code Commit and load the attached HTML.</p><p>§ Create and configure an S3 bucket to host your static website.</p><p>§ Create a CI/CD pipeline using the AWS Code Pipeline service</p><p>§ Set your repo as the Source Stage of the Code Pipeline that is triggered when an update is made to Code Commit</p><p>§ Deploy stage will equal the S3 bucket created</p><p>§ Pipeline should be deployed, and verification of the static website should be met.</p><p>§ Update the code in your Code Commit repo and verify that the Code Pipeline is triggered meaning your pipeline created works.</p><p><strong>Step 1</strong>: Navigate to the AWS Console and Locate Code Commit Service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*TVV8cSpSsMpKSAKLCUAlig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*n4ekHsk5S8ZpWgEk3Ryshg.png" /><figcaption>· Name your Repo and Click ‘Create’</figcaption></figure><p><strong>Step 2</strong>: Upload HTML file provided (If any).</p><p>Navigate to the right side of the Repository window and Click ‘Add File’. You have the choice of creating or uploading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*aM5nFquhPu1FzKbArMr-rQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Gd4J7W72SLySLBJo6l19Iw.png" /><figcaption>I uploaded the file provided in this case.</figcaption></figure><p><strong>Step 3</strong>: Navigate to the ‘Amazon S3’ Service to create a bucket</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*rVK4POafdBJrN__dh4lT5A.png" /></figure><p>· Enter a name for your bucket as well as select your region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*7lr7pjh7imzpIY3wLP8Kvw.png" /></figure><p>· Unselect ‘Block all public access’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*HW76eu85ZRo-YR3Tif0Lzw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*c6mzgJZR2S0KYU2GOTXEOw.png" /></figure><p>· Leaving all other selections as their default settings, click ‘Create’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*Kb0tZKrmciRgJme3LA4opA.png" /></figure><p>After your bucket is created, we can now enable the static website hosting for your bucket.</p><p><strong>Step 4: Enable static website hosting</strong></p><p>· Choose the name of the bucket that you want to enable static website hosting for. (The one we just created. I.e.: project10-awr)</p><p>· Choose ‘Properties’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*th2l5O1w45ivsnX14KaDHA.png" /></figure><p>· Scroll down to ‘Static website hosting’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*eirl-HZW0fuQx8FeY_7-0A.png" /></figure><p>Click on Edit, then ‘Enable’.</p><p>· Hosting Type: ‘Host a static website’</p><p>· Under Index Document:</p><p>Enter the ‘name of the file’ you would like to host. i.e.: website.html</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*OUpmbmVtpAiNnjSKiiXphA.png" /><figcaption>Choose ‘Save changes’</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*uz03GQLDYMWpl4jn8gC_Rg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*jeTk9d4DMRxFcS3vDwYdLw.png" /></figure><p><strong>Step 5</strong>: Now we need to update our permissions to allow public access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*EDXwL4ZqogidN5Z-jNW3PA.png" /></figure><p>Under Bucket Policy, click ‘Edit’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*0XPv7GIKO8P0_kGj_2mOYg.png" /></figure><p>· A window like the below window should populate. Click on the ‘Policy Generator’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*3PlgX29qwlCTcIbJLpm6Zw.png" /></figure><p>·Another new window will populate so that you are able to execute the requirements of this step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*I_Mm4HE6uvXe__-5dJAUTA.png" /></figure><p><strong>Under Step 1:</strong> Select Policy Type:</p><p>Select the ‘Bucket Policy’ from the drop-down window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*NcJGlKeiYmhnPjO7X14Skw.png" /></figure><p><strong>Under Step 2: Add Statement:</strong> Make the below selections<strong><br> </strong>(See the below screenshot)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*TN3aXmZVfRwpIiz74N2PXQ.png" /></figure><p>· Effect: ‘Allow’</p><p>· Actions: ‘GetObject’ (From the drop-down window)</p><p>· Principal: ‘*’</p><p>· ARN: (paste you bucket information here. I copied the ‘Bucket ARN’ from the earlier Bucket Policy Window. (See below)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*NQD__SCUt65Fcsa7jtG1Ow.png" /></figure><p>· Click ‘Add Statement’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*TN3aXmZVfRwpIiz74N2PXQ.png" /></figure><p>· Click ‘Generate Policy’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Z07vWnFgqxV2Grn5Efcz9A.png" /></figure><p>After clicking ‘Generate Policy’: The below window should populate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*MZ_AKw9GsrKoLmO1fW63Tg.png" /></figure><ul><li>Copy the code from this window. 😊 You will need it.</li><li>Navigate back to the ‘Bucket Policy’ window</li><li>If any code is present, kindly remove it and paste the code you copied</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*RmLHGBitP3StNga-zgv5ew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*_bIqJT1zJ3f9i1u2uvxphQ.png" /><figcaption>· Click ‘Save Changes’</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*hm6jMO9d1qttwjWcHx0Mrg.png" /></figure><p><strong>Step 6</strong>: Create a CI/CD pipeline using <strong>AWS Code pipeline service</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*VGrh6CENyG1_VY7yx2loTA.png" /></figure><p>· Name your Pipeline</p><p>· Select ‘New Service Role’ if not previously selected</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*VPQkvzHZkTp_V66xj_jq9w.png" /></figure><p>· Click ‘Next’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*SSeMjHcSLrLpSbXB7H18eQ.png" /></figure><p>I added ‘Code Commit’ as the Source provider as instructed and also entered my Repo name as shown above.</p><p>I left the below selections unchanged as they were defaults</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*wNDjFidVAPIfGtjhZr0zUA.png" /></figure><p>**I skipped the Build Stage for this project**</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*OtOeWuECPUGYz_jHblPxwg.png" /></figure><p>You will be prompted with the below window. Confirm ‘Skip’ to go ahead to the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*T4g8g7oVmsN324qzOqty9Q.png" /></figure><p>· Set Deploy Provider as your S3 Bucket.</p><p>·Select- Amazon S3.</p><p>· Enter Your S3 Bucket</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*ouaNfqVmy91PhGR0MdFMKg.png" /><figcaption>Then, Select Next.</figcaption></figure><p>· Review info for accuracy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*uLTqMrB8UL7d6iYG4Zn7LQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*QLm-13yjVe-0ijVY411rXg.png" /></figure><p>· Click ‘Create Pipeline’</p><p>&gt;&gt;&gt;Let’s see if it works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LMcBzyR0N3jg8HCqdsQeqQ.png" /><figcaption>It Works!!!</figcaption></figure><p><strong>Step 7:</strong> Deploy &amp; verify that you can reach the static website:</p><p>· Navigate to S3 in a new browser tab</p><p>· Click on the S3 bucket name: project10-awr</p><p>· Click Properties</p><p>· Scroll to the bottom of the page and under Static website hosting, click the Bucket website endpoint URL</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*6pQ2wO3jo8MKSb0PJfA1-Q.png" /></figure><p>Proof it Works!!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*GWeWYiR705I1cecF0c9xkA.png" /></figure><p><strong>Final Step</strong>: Let’s update the code and deploy it again.</p><p>Navigate back to ‘Code Commit’</p><p>Click on your repository</p><p>Click on the file in your repository</p><p>Edit File, entering your choice of wording, then save. (Commit changes)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PqG6rv02PPbhN31Wg4GgDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wlRc9lwvjInH7uOayuXssA.png" /></figure><p>Now let’s repeat Step 7.</p><p><strong>Step 7:</strong> Deploy &amp; verify that you can reach the static website:</p><p>· Navigate to S3 in a new browser tab</p><p>· Click on the S3 bucket name: project10-awr</p><p>· Click Properties</p><p>· Scroll to the bottom of the page and under Static website hosting, click the Bucket website endpoint URL</p><p>· And voila!!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*yAA4m8qX-vDy1Bfilo1jRw.png" /></figure><p>Congratulations 🎊!!!! You made it to the end. I hope executing this project was as much fun for you as it was for me. I have a different appreciation for CI/CD now that I am on the other side of the wall. And learning the Dev in conjuction with the Ops knowledge made this projects completion a little sweeter. I hope that you were able to reach your desired outcome. Thank you for joining me. Until next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c24f0ceaaef0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Constructing a 3-Tier Web-App via AWS]]></title>
            <link>https://medium.com/@alexusrozier/constructing-a-3-tier-web-app-via-aws-4f51710fba10?source=rss-13ec7bf3bed4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f51710fba10</guid>
            <dc:creator><![CDATA[Alexus R.]]></dc:creator>
            <pubDate>Sun, 11 Dec 2022 17:47:04 GMT</pubDate>
            <atom:updated>2022-12-11T17:49:30.396Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*QPjBW6xmblo89sRPjbuZLw.png" /></figure><p>This article will cover a project completed on how a highly available 3-Tier Architecture Web Application was constructed using Amazon Web Services.</p><p>To be successful at this execution, you need working knowledge what a 3-Tier Architecture is and why it’s important. <a href="https://docs.aws.amazon.com/whitepapers/latest/serverless-multi-tier-architectures-api-gateway-lambda/three-tier-architecture-overview.html">Amazon Web Services</a> has some very useful information on this topic. It consists of 3 tiers: the web tier, application tier, and database tier.</p><p>Scope of this project states that we need to design a 3- Tier Architecture. It would be helpful to have an AWS account and access to the AWS Console. Once you are logged in. We can get started. Or if you would just like to read how I went about completing this project, please join me below.</p><p><strong>Tier 1 of Project:</strong></p><p><strong>Create Web Layer for your 3-Tier Architecture</strong></p><p><strong>Step 1:</strong> First, Let’s Create a VPC:</p><p>( I chose VPC Only, However, VPC &amp; More is a much more efficient option.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*SWbxmWnPrGUFpan9ZuKq2Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*4G_GCYjr8RmHfBn6qdAY2A.png" /></figure><p><strong>Step 2:</strong> Create Subnets:</p><p>(Tip: Utilizing 10.10.0.0/24…10.10.1.0/24..and so on and so forth until all 6 subnets are created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*PR1WstgUFdv0cf4yw1cWkg.png" /></figure><p><strong>Step 3: </strong>Create an Internet Gateway (Located in the left side panel of the window)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*5bfE_29SdGDO6NZ5H2ctWg.png" /></figure><p>Once selected, you should see the below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*plXswNqU1Ocs3XzCh1_REA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*gLLO1PF0t2OTXWWD7hFLvA.png" /><figcaption>Then Attach to VPC that we just created.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*sAjOLYRMDmwSIWPM2ILebQ.png" /></figure><p><strong>Step 4:</strong> Create a Route Table or Two (Located in the Left Side Panel)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*__4xAHTXf9uG7ol0uWRpzg.png" /></figure><p>Select “create route table”</p><p><strong>Step 5</strong>: Under the Actions selection, select edit route, add a route, and configure a route to the following destination: 0.0.0.0/0 and Target: Internet Gateway ( that you created)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*VNNPTpXoV3-PfLA26Zbr_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*lCZ2H-xA0WswznLtPZr_vw.png" /></figure><p>Next, we will edit subnet associations- Still within the Route Tables window, scroll down ‘Subnet Associations’ tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*4dvMLPy58735h2VO8e44qQ.png" /></figure><p><strong>Step 6:</strong> <strong>Edit subnet associations</strong></p><p>Select subnets that correlate. I.e. PublicWeb1 &amp; PublicWeb2 or PrivateApp1 &amp; PrivateApp2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ohG9r-mMRUNHga8-LiPQnw.png" /></figure><p>Select “Save associations”</p><p><strong>Step 7</strong>: Create Launch Template</p><p>Navigate to ‘Instances<strong>’ </strong>and click ‘<em>Launch templates’</em></p><p><strong><em>Create launch template</em></strong></p><p>o Name Your Template</p><p>o Auto Scaling guidance (Select <em>“Provide guidance to help me set up a template that I can use with EC2 Auto Scaling”)</em></p><ul><li>Instance type :Select t2.micro</li><li>Select the AMI: I chose ‘Amazon Linux’</li><li>Create or select an existing key pair</li><li>Configure security group rules. For this step, we will create two rules for SSH<strong> </strong>and HTTP with 0.0.0.0/0 as the source. Setting the source to 0.0.0.0/0 will allow <em>all</em> IP addresses to access the instance.</li><li>Under Advanced Network Configuration ..Select ‘ENABLE’:<strong> </strong>Auto-assign public IP</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*MpFeH3bVnN_MXV0m-A2m9g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*GO0jjANf47gEZNKcVN-OtA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*qf7IcdWhQxEIcWWuFX1Bdw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*mAs6xUd6NZyzAobgxUu3GA.png" /></figure><ul><li>In the<strong> </strong>Advanced Details section, add the below script under<strong> </strong>‘User data’</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*LggQ1-SgMvPogiobChtzOA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*0IK10QgjidGcslDyI0F0Dw.png" /></figure><p><strong>Step 8</strong>: Click ‘Create Auto Scaling group’ from the Next Steps section as seen in the below window</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*IPuna3R1jlzWxj7zw4O7sw.png" /></figure><p><strong>Step 9:</strong> Choose the VPC and Availability Zones. (See below screenshot)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*ViO9PvRkmRGuilharsRn5A.png" /></figure><p><strong>Step 10</strong>: In the ‘Load Balancing’ section:</p><p>Select ‘Attach to a new load balancer’</p><p>Under Attach to a new load balancer’</p><p>Select ‘Application Load Balancer’</p><p>Load Balancer Name- Name your Load Balancer (ie: ASG-Pj9–1)</p><p>Load balancer scheme select ‘Internet-facing’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*FQBAGtAHtNZX9b7q1WiFEA.png" /></figure><p>Under ‘Network mapping’</p><p>1. Attach your VPC</p><p>2. Select your subnets</p><p>Ø Under Listeners and routing: HTTP:80</p><p>Ø New target group name — Attach your load balancer: ASG-Pj9–1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*-zsW-BpJUYRZaVzK04hw1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*MJwCzFKTanElcX4ExNybew.png" /></figure><p>Go to your EC2 Instances</p><p>Copy Public IPv4 address and Test your Apache Webpage: I did so by pasting the <a href="http://(public/">http://(PUBLIC</a> IPv4 address) in an Incognito Window</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*nIk50fqWe5hWs_cb8c9Fbg.png" /></figure><p><strong>Tier 2 of Project:</strong></p><p><strong>Create Application Tier for your 3-Tier Architect</strong></p><p>******Moment of Transparency: I ended up having to go back and delete the Subnets I created in Tier 1. So here we will continue with creating subnets for this Tier (Application)*****</p><p><strong>Step 1:</strong> In the VPC console, navigate to “subnets”</p><p>Click <strong>Create subnet</strong></p><p>Select the VPC ID you created in Step #1</p><p>Availability Zone three in <em>us-east-1a</em> &amp; three in <em>us-east-1b</em></p><p>CIDR block range</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*XWBITBR6a7kOatVzHQKz5Q.png" /></figure><p>Now we will create a route table for the Application Tier:</p><p><strong>Step 2</strong>: In the VPC console, navigate to “Route Tables.”</p><p>Click <strong>Create route table.</strong></p><p>Name your Route Table</p><p>Attach the VPC you created in Step#1.</p><p>Click<strong> Create route table </strong>to complete this step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*OBIyXCtHpqA6wbP-3nLlwA.png" /></figure><p><strong>Step 3: </strong>Create an Auto-scaling group for the Application Tier:</p><p>Search EC2</p><p>Click ‘Auto Scaling Groups’ on the left-hand side of the console, and ‘Create an Auto Scaling Group’</p><p>Click ‘Switch to launch configuration’</p><p>Name your Auto-scaling group</p><p>Duplicate and Open up another browser and grab the EC2 instance AMI <em>(You should grab the Amazon Linux 2 AMI (HVM) — Kernel 5.10 free tier)</em></p><p>Under Instance Type — Type “t2” and select ‘t2.micro’</p><p>Under Security Groups — Create a new security group/Name your security group.</p><p>Under Key pair — I will choose an existing key pair or create a new key pair</p><p>Click ‘Create launch configuration’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*4u4ZoHTClvClb0anIVMisg.png" /></figure><p><strong>Step 4</strong>: Navigate over to EC2 Instances.</p><p>Select your newly created EC2 and click ‘Actions’ ….’Create Auto Scaling Group’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*hrmF0tPUT_4lNLoIyyn1Kw.png" /></figure><p>Name your Auto Scaling group and your VPC will already be attached. Click <strong>Next</strong> to continue.</p><p>Under Network : Select your corresponding AZs &amp; subnets from your Application Tier</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*_6_TBjT_TYgxgvHAeUwTUA.png" /></figure><p><strong>Step 5:</strong> Click Next to get to the ‘Configure advanced options’</p><p>(See the below window and make the appropriate selections)</p><p>-No load balancer</p><p>-Health Checks (EC2 should be selected)</p><p>-Additional settings (Optional)/No selection required</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*CjFCgY89eKzHDAsdzdesww.png" /></figure><p>Click Next. Then select the ‘Group Size’</p><p>Desired Capacity-2</p><p>Minimum Capacity-2</p><p>Maximum Capacity -5</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*8WJ-p3n6n91zLK3WBecRgQ.png" /></figure><p>Add notifications and Add tags are optional</p><p>Click Next and Review</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*P6ZP5uvI1t1D9-qKBSmTkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Q94bK2OnDFcjUskx8IPTOQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*1hP4TXED3zV0gTHcIX5w4A.png" /></figure><p><strong>Step 6:</strong> Final Step for this Tier: Create Auto Scaling Group</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Fy5dPDnJRU1Caq86Z6BL7w.png" /></figure><p>******Next we will create the final Tier. (Hang in there, we are almost to the finish line)</p><p><strong>Tier 3 of Project:</strong></p><p><strong>Create Database Layer for your 3-Tier Architecture</strong></p><p><strong>Step 1:</strong> Create two (2) private subnets in the VPC for the Database tier. Follow the steps from the Application Tier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*8_9WKDN_QXLv2GFoMw0IkA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*TUCOKaptVaLBa1Wi4uMvjw.png" /></figure><p><strong>Step 2:</strong> Create a Private Routing Table for the Database tier &amp; associate the two Private subnets you just created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*o05YedmFKT79nOGD6tCjPw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*C5AfyPNuaG97d2tZAb7aTg.png" /></figure><p><strong>Step 3:</strong> Create a Subnet group for the Database Tier</p><p>In the AWS Console, search “RDS” and click Subnet groups</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/1*u4yzC8O36l6X4ZV5PLjPXw.png" /></figure><p>Create DB subnet group</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*OcX-WPS6mW8qW8gLT_ZENg.png" /></figure><p>Name your subnet group</p><p>Select your VPC</p><p>Select your Availability Zones &amp; subnets for your Database Tier</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*1BdYFymkeVL9KyJcZvakGQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*13QrUqY_slBxLWF4Y9COvg.png" /></figure><p><strong>Step 4: Create</strong> Database for your Database Tier:</p><p>In the AWS Console, search “RDS” and select ‘Create Database’</p><p>Select ‘Standard Create’</p><p>Under Engine Options, select ‘My SQL’</p><p>Under Templates, select ‘Free Tier’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*d8J0FrI6IiQiRCAHnYoXxg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*I7CWJS0VPVTnFjlm9-5_AA.png" /></figure><p>Under settings, add a password for the admin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*MDIhJeEAmL73zLgK3eAjjA.png" /></figure><p>Under ‘Storage’, deselect “Enable storage autoscaling”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*hdM6DgWyc_zdHhZzOIfI7Q.png" /></figure><p>Under connectivity, Make the below selections:</p><p>Don’t connect to an EC2 Resource</p><p>Select IPv4 as the ‘Network Type’</p><p>Select your VPC and Subnet ( Not Default as shown below) group we just created, and create a new VPC security group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*gdU0dEANjvwjl128C_pBVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*B565yJYwKUC7ceHrBzb8Xw.png" /></figure><p>Next we will: Update the connectivity between the Database and the Application Tiers</p><p><strong>Step 5:</strong> Click on the database you just created</p><p>Under ‘Connectivity &amp; Security’ tab, click on the hyperlink under ‘VPC Security Groups’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Z2KjvuVpAy7otBMPM89UHg.png" /></figure><p>Under Inbound rules, Click Edit Inbound rules</p><p>Click ‘Add rule’</p><p>Type 3306 in the port range (MySQL protocol)</p><p>Source, select your Application tier security group</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*7-W7GMalm3DgnI6pJZSSvA.png" /></figure><p><strong>Step 6</strong>: Create a NAT Gateway to a route all traffic</p><p>In this step, we will make a NAT Gateway in a public subnet and route all internet traffic from the private route table to the NAT Gateway.</p><p>In the VPC console, go to ‘NAT Gateways’</p><p>Click ‘Create NAT Gateway’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*RNeHX-IkvQpSu-u30s6mwg.png" /></figure><p>Assign the NAT Gateway to the correct subnet</p><p>Connectivity type <strong>‘</strong>Public’</p><p>Elastic IP allocation ID — select ‘Allocate Elastic IP’<strong> </strong>and Allow ‘AWS to<strong> </strong>generate an EIP address’</p><p>Click <strong>Create NAT gateway</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*4eB-hrgc2Wt6EGQUU3_rpA.png" /></figure><p><strong>Step 7</strong>: Direct the public route table to the Internet:</p><p>In the VPC console, go to Route Tables</p><p>Select the Public Route Table ie: ‘WebMyRTC1’</p><p>Click on the <strong>R</strong>outes<strong> </strong>tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*CMS_CyhNRAquDiUgvnHCuw.png" /></figure><p>Click ‘Edit Routes<strong>’</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*nh-CJrYLGcxxe8aUWAS3Yg.png" /></figure><p>Click ‘Add Route<strong>’</strong></p><p>For Target, select ‘Internet Gateway<strong>’</strong></p><p>For Destination, select ‘0.0.0.0/0<strong>’</strong></p><p>Click ‘Save changes’</p><p><strong>Step 8: </strong>Direct the Private Subnets to the NAT gateway</p><p>Select the Private Route Table. I’ll use “AppMyRT2” &amp; “DBMyRT3”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*CMS_CyhNRAquDiUgvnHCuw.png" /></figure><p>Click on the ‘Routes’ tab.</p><p>Click ‘Edit routes’</p><p>Click ‘Add route’</p><p>For Target, select ‘NAT Gateway’</p><p>For Destination, select ‘0.0.0.0/0&#39;</p><p>Click ‘Save changes’</p><p>**Verification of Deliverables**</p><p>&gt; Make sure you can access the web tier web page from the internet.</p><p>&gt;From the web tier verify that you can ping the application tier from the web tier by running the ping command from an EC2 instance in the web tier.</p><p>&gt; Connect to your Public EC2 instance and use the below command to ping the private application instance.</p><pre><br>ping &lt;private IP address of private app instance&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*AJd5QsALh2PY7OHt3Rf8dA.png" /></figure><p>Congratulations 🎊!!!! You made it to the end. I hope executing this project was as much fun for you as it was for me. I have been told there is more than one way to skin a cat, well this skinning was fun, I will say that. I had my share of error messages and hiccups. But making it to the desired outcome made it all worth it.</p><p>Until next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f51710fba10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a DynamoDB table using AWS Console and Retrieving via CLI]]></title>
            <link>https://medium.com/@alexusrozier/creating-a-dynamodb-table-using-aws-console-and-retrieving-via-cli-8e03575bcbcc?source=rss-13ec7bf3bed4------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e03575bcbcc</guid>
            <dc:creator><![CDATA[Alexus R.]]></dc:creator>
            <pubDate>Mon, 14 Nov 2022 19:32:19 GMT</pubDate>
            <atom:updated>2022-11-14T19:32:19.702Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/311/1*YJNpYVUKreDDlh5f62EgOg.png" /></figure><p>Hello and Welcome. In this exercise/tutorial, I will be documenting how I went about creating a functioning DynamoDB table from the AWS Console then retrieving my information via the AWS CLI. What is DynamoDB anyway? According the Amazon docs; in DynamoDB, tables, items, and attributes are the core components that you work with. A table is a collection of items, and each item is a collection of attributes. DynamoDB uses primary keys to uniquely identify each item in a table and secondary indexes to provide more querying flexibility. In this exercise, my data is based on a few of my favorite books.</p><p>Now for the exercise that I completed. It required the following:</p><p>&gt; Create a DynamoDB table for something of your choosing (e.g. movies, food, games).</p><p>&gt;Add 10 or more items to the table.</p><p>&gt;Create a t.2micro Ec2 instance.</p><p>&gt;Using an IAM role and the principle of least privilege, grant the EC2 instance read access to DynamoDB.</p><p>&gt;Use the AWS CLI in the EC2 instance to scan the DynamoDB table.</p><p>&gt;Use the AWS CLI in the EC2 instance to validate you cannot write an item to the DynamoDB table.</p><p>Okay, so now that we have our objective, let’s get started.</p><p>Log into the AWS Console. Then head on over to the IAM feature and add a User.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*dFApfDQti7OC2XbwEhy0mA.png" /></figure><p>Next let’s add some permissions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*fEyMZeMMY1CK9QOzHsk4hg.png" /></figure><p>Then click Next:Tags, followed by Next: Review. Finally Create User</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*20OjoFQCdN1adNTwAWs7WQ.png" /></figure><p>Next we will need to create a Role for the EC2 Instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FNe6JWmTjMN2xU-idbBvgQ.png" /></figure><p>Add permissions as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BwqrVJzADKlyeLpOJM7Daw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HqiQaDp6OxwA4IjXq5ztdg.png" /></figure><p>Lastly, Add permissions for the Role: Then Create Role</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MFHOGdhT2p-4-1R7ZsYlDw.png" /></figure><p>Step 3: We will need to create an EC2 Instance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*-MZZwtZw2yrC8bPOntPmLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*42-Dz-59aN3Ty_iBsVr7Sg.png" /><figcaption>Create a new Key Pair</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*29w-PngoiyNGizP1lroStw.png" /></figure><p>Scroll down to Advanced Settings and under ‘User Data’, type the below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*NW4ktJcQdD4zPJkjHm549A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*xDFK3bMf7goD1vx8zofQPg.png" /></figure><p>Once Instance has been launched. It will need a few moments to boot up. While this is happening, head over to the DynamoDB feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*24FfunPL4I8ZL_PHb3zSwA.png" /></figure><p>Once you have clicked the ‘Create Table’ button, now its time to enter the below info.</p><p>•<strong>Table name</strong>:( Name of your table) (ie: FavBooks)</p><p>• <strong><em>Partition key</em></strong> : ( ie: Author)</p><p>• <strong><em>Sort key : (ie: </em></strong>Title)</p><p>•Click <strong>Create table</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*DDEj3Z0qstCqg3qU96-tCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*hqffai0Zog65WwPjIobhSw.png" /></figure><p>Now its time to add Items to your Table. To do this, navigate to the below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JuLc1Q8dQXX0FaLko1q0Pg.png" /><figcaption>Select the Table just created. Under Actions, select Explore Items.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ke5S0ku4S2B4eLHPdSDdAg.png" /><figcaption>Click Create Item</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M_OrtDl7iKAKSw2N8nCNMA.png" /><figcaption>Once info is entered, click Create Item</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6DWOfosf8rU1bp6Bh8Di7Q.png" /><figcaption>Continue creating items until a minimum of 10 items have been created.</figcaption></figure><p>Once complete creating items. You will need to adjust a security feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xdL-KLpRKTt_kkuCyTn56g.png" /><figcaption>Under the Instance created, go to Actions and select Security, then Modify IAM role.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*OTEpQuQngP23kGb0wUoXwA.png" /></figure><p>Next its time to connect to the instance so that we can view the table via the AWS CLI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*yNqcwEHN8M-trXRZa6Aujg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*bg7VTalmskn3-KTCOavXjw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3-ze6oOP4JK_SjbJdHt9Cw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*AoShgpjPZZfSwnH8kC0rOA.png" /><figcaption>We success.</figcaption></figure><p>•Next, we will test our permissions to see if we are able to write to our table. We should not be able to do so because we only have read access.</p><p>Use the below AWS CLI command for to see if we are able to make changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CL6IxVbgoXU18i8NEl5dqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n_VF-qkBHumzgKVwz6-IWQ.png" /><figcaption>I received an error message , that access was denied.</figcaption></figure><p>It appears as though the test was a success. Thanks for hanging out with me. I hope that we can do this again soon. Until then, happy problem solving. Best.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e03575bcbcc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating an Auto-Scaling Group of EC2 Instances for High Availability]]></title>
            <link>https://medium.com/@alexusrozier/creating-an-auto-scaling-group-of-ec2-instances-for-high-availability-59eb19e50017?source=rss-13ec7bf3bed4------2</link>
            <guid isPermaLink="false">https://medium.com/p/59eb19e50017</guid>
            <dc:creator><![CDATA[Alexus R.]]></dc:creator>
            <pubDate>Sun, 13 Nov 2022 05:48:00 GMT</pubDate>
            <atom:updated>2022-11-13T05:48:00.471Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*UatnW0oMGjmLYJVM67z-eQ.png" /></figure><p>Hello There and Welcome to my page. In this article, I will explain how I went about creating the above diagram and why it is important. The benefit of Auto scaling is that it will allow for an infrastructure to be built without fully knowing the needed capacity. When the highest level of demand is unknown, auto scaling will allow the ability of the infrastructure to adjust on its own. In following the below steps, hopefully, you are able to fulfill and reach the same output that I did. Okay, let’s get started.</p><p>(Prelimiaries: Be sure you are logged into the AWS Console. This would be the only way I know that you would be able to complete the below. At least this is how I did it.)</p><p>Step 1: Create a VPC with cidr 10.10.0.0/16</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*ErshjHk47HfIKMsyRqXUqw.png" /><figcaption>I chose VPC and more option, as it allowed for quicker access to everything needed to complete in a timely manner.</figcaption></figure><p>Step 2: Create three public subnets with 10.10.1.0/24 &amp; 10.10.2.0/24 &amp; 10.10.3.0/24. ( I chose 3 availability zones for high availability)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*luq0jgeqi64RcQXo64Xn2w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*mvrsMossP62coKS6BakLjg.png" /><figcaption>Once VPC is created, verify all that you entered is present. See below.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XI6ixKTByIeQCnsweSGL2w.png" /></figure><p>Step 3: Create a Launch Template for prior to creating an autoscaling group using t2.micro instances. All instances should have apache installed on each instance with the ability to check any random IP address and be able to produce a test page. Ensure the autoscaling group is using the public subnets from #2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*UT5FbvHVK9wIRPAnwq91Lw.png" /></figure><p>I chose Amazon Linux 2 AMI for the below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*Hgu5jHGypExn7QQl1hqmGQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*uTfE882PJQQm35wLFgRwXQ.png" /><figcaption>Note: Be sure to use/ create a key pair</figcaption></figure><p>Step 4: Create web server security group that allows inbound traffic from HTTP from your Application Load Balancer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*thiYX5QmC-wABJ0ddSMr9w.png" /></figure><p>Head on down to the Advanced Details under the User Data field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*0iklaVw_kTqthglMalexpw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*9WEToPPsSJ_R9hiVIxF2KA.png" /><figcaption>Entering the above script will allow for Apache to be installed</figcaption></figure><p>Once script is entered, verify that all information has been entered prior to creating Launch Template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*Bbj-T4iKwGkuqqgebeLYyg.png" /></figure><p>Step 5: Once template have been created. Now you should be able to create the Auto Scaling Group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2EBe8yVlGTUEjEuG779crg.png" /><figcaption>Note: Be sure to enter the Launch Template that was previously created.</figcaption></figure><p>Under the Network, chose the VPC and subnets that were created previously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ebrFU7C57peHZAQ1ZsyPg.png" /></figure><p>Step 6: Create a load balancer security group that allows inbound traffic from TTP from 0.0.0.0/0.</p><p>Step 7: Create an Application Load Balancer to distribute traffic to the autoscaling group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*fSRpWiZVuw_WcwGsDM6mDg.png" /></figure><p>Step 8: The autoscaling min and max should be 2 and 5.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*Olk1Si3VMi8km7MBKKJuWQ.png" /></figure><p>Once complete. Click the create Auto Scaling Group button. Verify group has been created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EOtf-md2TeGCJbcDQpNWvQ.png" /></figure><p>Step 9: Now we will go over to your instance and grab the IP address and test it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RRukXyvpStwG_xdK-255Pg.png" /></figure><p>Congratulations. Hopefully every worked according to plan. If not, check your computer’s security and firewall. I know when I first gave this a go, I had a proxy issue. And ain’t nobody got time for that. :-) Alrighty then. That’s all for now. Until next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59eb19e50017" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS-Foundations: Creating an EC2 Instance using AWS CLI]]></title>
            <link>https://medium.com/@alexusrozier/aws-foundations-creating-an-ec2-instance-using-aws-cli-751199a2922e?source=rss-13ec7bf3bed4------2</link>
            <guid isPermaLink="false">https://medium.com/p/751199a2922e</guid>
            <dc:creator><![CDATA[Alexus R.]]></dc:creator>
            <pubDate>Sun, 06 Nov 2022 00:51:24 GMT</pubDate>
            <atom:updated>2022-11-06T00:51:24.742Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*n0dTHkrD-Ly6kzN8uyO70A.jpeg" /></figure><p>Hello and Welcome to Becoming One with The Cloud. Here I will post the projects executed while navigating through the <a href="https://www.linkedin.com/company/level-up-in-tech/">LEVEL UP IN TECH</a> DevOps/Cloud Engineer Bootcamp. This is my 3rd publication to this platform. Let me tell you, if you haven’t already heard, <a href="https://aws.amazon.com/console/">AWS</a> has soooooo much to offer. I mean really. You should take a look if you haven’t already. Did you know that there is more than one way to spin up an EC2 instance? Well I learned 3 different ways: CLI from your PC(PuTTy), AWS CLI, AWS Console. Now 2 were were intentional, the other, well that was the luck of the draw. Any who, please check out the below and see how I went about spinning up an EC2 Instance using the AWS console.</p><p>The objective of this Project was to:</p><p>&gt; Create a t2.micro EC2 instance with the OS of your choice</p><p>&gt; In the user-data field, use a script that updates all packages, installs Apache, and starts the Apache service.</p><p>Step 1: Let’s start by logging in the <a href="https://aws.amazon.com/console/">AWS Management Console</a>.</p><p>(Note: If you don’t currently have access, now would be a great time to get your account set up; it won’t take long at all.)</p><p>Step 2: Once you’re logged in, Head on over to EC2 Instance, and utilize the drop down shown below:</p><p>Step 3:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6_FhNmUw4oKp_sTw.png" /></figure><p>(Note: for the purpose of my project I will be using the following specifics to create my instance : Linux t2.micro (free tier) in a public subnet…see below)</p><p>Step 4:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/0*2spWgm7s6W4wX39n.png" /></figure><p>&gt;&gt;Prior to completing the next steps: Be sure to have created a <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html">Keypair</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kyS1CQmSI3CChaAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/0*-9G1XgVT2V7cXwnh.png" /></figure><p>Once key pair is created, head back to step one to Create Instance again, that way you are able to attach your newly created keypair. (Complete steps 1–4)</p><p>Step 5: Create a security group. See below for example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*wqka2HNXLbtK-_GEjyu8Sg.jpeg" /></figure><p>Step 6: Take the necessary steps to install Apache with a custom webpage using a BASH script.</p><p>While still in the Launch Instance screen…Scroll down to ‘Advanced details’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*D4YMA5FG7nUdwrYYLHpt1A.jpeg" /></figure><p>Under Advanced Details… navigate down to ‘User data’ field. Enter the below bash script to install Apache.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/0*X6YFK8LZzwgkdn8j.png" /></figure><p>Hopefully it works. Congratulations!! You did it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/0*6xStD4APhQxC7rKh.png" /></figure><p>If it didn’t work, I would advise you check your script, or your security selections and give it another go..Alrighty, again this was fun. I look forward to sharing with you in my next publication on…Becoming One with The Cloud. Don’t forget click that follow button in my profile and Connect with me on LinkedIn. Until next time. Take care.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=751199a2922e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>