<?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 Kashawn Shifflett on Medium]]></title>
        <description><![CDATA[Stories by Kashawn Shifflett on Medium]]></description>
        <link>https://medium.com/@shifflettko?source=rss-65caae5a9499------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*YLM1_RUZNZy35pgj</url>
            <title>Stories by Kashawn Shifflett on Medium</title>
            <link>https://medium.com/@shifflettko?source=rss-65caae5a9499------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 08:33:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shifflettko/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[EKS Cluster In AWS]]></title>
            <link>https://medium.com/@shifflettko/eks-cluster-in-aws-9d6dace5fdac?source=rss-65caae5a9499------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d6dace5fdac</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Kashawn Shifflett]]></dc:creator>
            <pubDate>Fri, 11 Nov 2022 02:44:01 GMT</pubDate>
            <atom:updated>2022-11-11T02:48:24.705Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dX7xcqSd1zBtfbGB" /><figcaption>Photo by <a href="https://unsplash.com/@mischievous_penguins?utm_source=medium&amp;utm_medium=referral">Casey Horner</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This project will guide you through how to create an EKS Cluster, while using Terraform!</p><p><strong><em>Prerequisite:</em></strong></p><ul><li>AWS Console Account</li><li>MFA Code</li><li>Cloud9 (or some type of IDE)</li><li>Terraform account</li><li>GitHub account</li></ul><p><strong>Goals for this project:</strong></p><ul><li>Create an EKS Cluster</li><li>Create a random string that allows 5 (or more) characters for the Cluster name</li><li>Print the output of the Cluster name</li></ul><p><strong>What is EKS? (</strong><a href="https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html">Amazon Elastic Kubernetes Service</a>) is a managed service that you can use to run Kubernetes (“K8”) on AWS without needing to install, operate, and maintain your own K8 control plane or nodes. K8 is an open-source system for automating the deployment, scaling, and management of containerized applications.</p><p><strong>What is Terraform?</strong> Terraform is an open-source, infrastructure as code, software tool.<strong> </strong><a href="https://www.terraform.io/intro">Terraform<strong> </strong></a>is both cloud and on-prem resources in <em>human-readable</em> configuration files that you can version, reuse and share.</p><p><strong>Step 1) Setup </strong>an Environment. You can use any IDE you would like. For this project I used Visual Studio Code (VSC).</p><p><a href="https://code.visualstudio.com/">Visual Studio Code - Build what comes next</a></p><p><strong>Step 2) Clone GitHub </strong>into VSC. To save time I’ll provide the code that’s used. When you start up VSC there’s an option to start from scratch or clone a repo. Enter/clone the repo:</p><p><a href="https://github.com/Shawn-Shifflett/week22-prov-eks">https://github.com/Shawn-Shifflett/week22-prov-eks</a>.</p><p>Once you’ve cloned the repo change into the directory that the repo is in.</p><p>Change into repo: cd week22-prov-eks</p><p><strong>Step 3) Terraform init</strong>. Use terraform init to pull the code into the environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*G_bGJexk_BlXxa80h7AAyQ.png" /><figcaption>terraform init</figcaption></figure><p>Green is <strong>good</strong>!! We can see that the terraform init ran properly.</p><p><strong>Step 4) Terraform apply</strong>. Now it’s time to get this code kick started. We need to terraform apply our code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sacwfED5_9D6SppLYDsgMA.png" /><figcaption>terraform apply</figcaption></figure><p><strong>Side note:</strong> Resource: 5 added, 0 changed, 2 destroyed. will look different if you run it correctly the first time. I had to do some modifying before I could run terraform apply.</p><p>However, remember “Green is good!” terraform apply is running properly.</p><p><strong>Step 5) Check!</strong> Now that we’ve terraform plan and terraform apply we can head over to the AWS Console to double check.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Q0LmGQnS_sLL55NK_9MiQ.png" /><figcaption>AWS Console VPC</figcaption></figure><p>We can see the VPC is created successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*haCzXfZdnsCFGMJ1nIky6g.png" /><figcaption>EKS</figcaption></figure><p>We can see the EKS Cluster is created successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gtke0tRBQaqfMS8UNj00Pw.png" /><figcaption>EC2</figcaption></figure><p>We can see the EC2s are created successfully.</p><p><strong>Step 6) Working with kubctl</strong>.</p><p>We need to run aws eks update-kubeconfig --name &lt;EKSname&gt; --region &lt;region&gt;. This command will gather credentials to access our cluster we created.</p><p><em>(I’d paste an image of what the above would look like but it can contain sensitive data)</em></p><p>Now that we have access to the EKS Cluster we need to run kubectl get nodes.</p><p>kubectl get nodes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*fcUfN9aM6rhxOSSd_psGMQ.png" /><figcaption>get nodes output</figcaption></figure><p><strong>Step 7) Terraform Cloud.</strong></p><p>Once the Workspace is setup (pretty simple walkthrough) we need to setup the Variables.</p><p>Variables needed:</p><ul><li>AWS_ACCESS_KEY_ID</li><li>AWS_SECRET_ACCESS_KEY</li><li>AWS_DEFAULT_REGION</li><li>CONFIRM_DESTROY</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*DZLTiuB_l55RG7OR2cy1YQ.png" /><figcaption>Terraform Cloud Variables</figcaption></figure><p>What are the values? What do we need to do? Make sure to set each variable to <strong><em>Sensitive</em></strong>. Set the following as;</p><p>AWS_ACCESS_KEY_ID = AWS Access Key</p><p>AWS_SECRET_ACCESS_KEY = AWS Secret Access Key</p><p>AWS_DEFAULT_REGION = The region you’re working in</p><p>CONFIRM_DESTROY = 1</p><p>Now that the Variables are set we need to start a run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*xdniYkIbui6RTOT1dSmWVQ.png" /><figcaption>Start new run in TC</figcaption></figure><p>Now that we’ve started a new run we can Plan and Apply within Terraform Cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*uIqCp0xDAebT1n0BkscFyQ.png" /></figure><p>Once the Apply is ran we can see the Outputs at the bottom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*1W5PsdOFuSZsdGtvJphBhA.png" /><figcaption>TC Plan and Apply Outputs</figcaption></figure><p>Of course we should double check on the AWS Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*QmAgapKCCzYwpXPhj0Fo1A.png" /><figcaption>TC Verification</figcaption></figure><p><strong>Step 8) DELETE!!</strong> Make sure to delete everything! If not <strong>you may be</strong> <strong>billed</strong> for something that’s <strong>not </strong>being used.</p><p><strong><em>Connecting:</em></strong></p><p>LinkedIn: <a href="https://www.linkedin.com/in/shawn-shifflett-59b73716b/">https://www.linkedin.com/in/shawn-shifflett-59b73716b/</a></p><p>GitHub: <a href="https://github.com/Shawn-Shifflett">Shawn-Shifflett (github.com)</a></p><p>Email: Shifflettko@battlers.ab.edu</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d6dace5fdac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pull Docker Image Into ECS Cluster]]></title>
            <link>https://medium.com/@shifflettko/pull-with-docker-f55cf2d322bb?source=rss-65caae5a9499------2</link>
            <guid isPermaLink="false">https://medium.com/p/f55cf2d322bb</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Kashawn Shifflett]]></dc:creator>
            <pubDate>Tue, 18 Oct 2022 19:11:41 GMT</pubDate>
            <atom:updated>2022-10-18T19:25:07.043Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-h0aT8xjZ4V3pgXZ" /><figcaption>Photo by <a href="https://unsplash.com/@carrier_lost?utm_source=medium&amp;utm_medium=referral">Ian Taylor</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This project will guide you through how to pull a CentOS image from Docker!</p><p><strong><em>Prerequisite:</em></strong></p><ul><li>AWS Console Account</li><li>MFA Code</li><li>Cloud9 (or some type of IDE)</li><li>Docker</li><li>Terraform</li></ul><p><strong>Goals for this project:</strong></p><ul><li>Pull a CentOS image from the Docker registry</li><li>Create an ECS cluster using the Docker image</li></ul><p><strong>What is Docker? </strong>Docker is a platform that allows you to build, test, and run applications quickly. Docker packages software together called <a href="https://aws.amazon.com/containers/"><strong>containers</strong></a> that have everything the software needs to run including libraries, code, and any extra requirements that might be needed. Docker can quickly deploy and scale applications into environments and the code will run.</p><p><strong>What is Terraform?</strong> Terraform is an open-source, infrastructure as code, software tool. <a href="https://www.terraform.io/intro"><strong>Terraform</strong> </a>is both cloud and on-prem resources in <em>human-readable</em> configuration files that you can version, reuse, and share.</p><p><strong>What is ECS? </strong><a href="https://aws.amazon.com/pm/ecs/?trk=65b3aebb-5f34-47a9-85a4-c95ef4d9629b&amp;sc_channel=ps&amp;s_kwcid=AL!4422!3!547620651283!e!!g!!aws%20ecs&amp;ef_id=Cj0KCQjwnbmaBhD-ARIsAGTPcfUFblZ5QECBaZ2JUVanB-BNpNPE8TKmOUOHGZ_Zd0qlfoG4KHeOXz0aAlIDEALw_wcB:G:s&amp;s_kwcid=AL!4422!3!547620651283!e!!g!!aws%20ecs"><strong>ECS </strong></a>is a managed container service that helps easily deploy, manage, and scale containerized applications.</p><p><strong>Step 1) Setup </strong>an Environment. You can use any IDE you would like. For this project I used Visual Studio Code.</p><p><a href="https://code.visualstudio.com/">Visual Studio Code - Build what comes next</a></p><p><strong>Step 2) Create files. </strong>First I created a directory called pullCentOS. In the terminal use mkdir pullCentOS. Once the directory is created move into it using; cd pullCentOS.</p><p><strong>Step 3) Create .tf files. </strong>Here we need to create some files for the project. Make sure to name them accordingly. Create these file using touch &lt;name of file&gt;.</p><p>The names I used for this project are;</p><p>mainCentOS.tf, provCentOS.tf, subCentOS.tf, varCentOS.tf, vpcCentOS.tf</p><p>This can be done on one touch line, that would look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SIbewKAGoGwJoYSMfZlz-A.png" /></figure><p>Or you can touch all the file names separately if you want to keep some organization.</p><p><strong>Step 4) Coding. </strong>Now that we have the files we want to use named we need to enter some code!</p><p>First lets start with vpcCentOS.tf this will create a VPC.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/47f8f2beda2f685a4e2574e194de2ad9/href">https://medium.com/media/47f8f2beda2f685a4e2574e194de2ad9/href</a></iframe><p>Next provCentOS.tf this will set our providers.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b9329cf9d6aa909a295143d2a62e8554/href">https://medium.com/media/b9329cf9d6aa909a295143d2a62e8554/href</a></iframe><p>Next varCentOS.tf this will create variables.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a9ad6300ddba3f7e934b9cf2492ca8f/href">https://medium.com/media/7a9ad6300ddba3f7e934b9cf2492ca8f/href</a></iframe><p>Next subCentOS.tf this will create subnets.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dbcdf534cf0802678959cf42adb908b0/href">https://medium.com/media/dbcdf534cf0802678959cf42adb908b0/href</a></iframe><p>Finally the mainCentOS.tf this is where we create the ECS cluster, target group and pull the CentOS image. Here we see everything come to life.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/58a8c1977ac0d9b0f30faf9a49737cff/href">https://medium.com/media/58a8c1977ac0d9b0f30faf9a49737cff/href</a></iframe><p><strong>Step 5) Running Terraform. </strong>Now that we have our code we need to run it with Terraform.</p><p>To kick things off we need to run terraform init. This will pull Terraform into the IDE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7wAie4DJK1rb_TJHzwfDGw.png" /><figcaption>successful terraform init code</figcaption></figure><p>We can see that terraform init is working correctly.</p><p><strong>Not</strong> required but something I like to do is use terraform fmt and terraform validate.</p><p>terraform fmt will format the code to be easier on the eyes.</p><p>terraform validate will assure that the code is working.</p><p>Next we need to use terraform plan this wont run the code but will gather the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cnQjMc5hJ2h_Q-_7RE6TNQ.png" /><figcaption>terraform plan pulling</figcaption></figure><p>You should see the above, this might take some time. Once terraform plan is finished you should see the summary of the plan:</p><pre>Plan: 15 to add, 0 to change, 0 to destroy.</pre><p>Now the fun part! It’s time to actually run and use the code. To do so enter terraform apply. Half way through you will be prompt to continue. Enter yes and watch your code come to life.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m4ReTfo-mFN4VzjsC4cBWg.png" /><figcaption>terraform apply code</figcaption></figure><p>If you see green and Apply complete! the apply ran correctly. However, the terraform plan summary said 15 to add and here only 9. That’s because I ran my terraform apply multiple times. If this is your first terraform apply you will see 15 instead of 9.</p><p><strong>Step 6) Check. </strong>Now that we’ve ran Terraform we need to head over to the AWS Console to make sure we can see what we’ve created.</p><p>Check for the VPC named main:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e_joKTaYWwPiRUYVsx9FYg.png" /><figcaption>AWS Console VPCs</figcaption></figure><p>Check for the subnets created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vdlc8xM1WDQkLuxe6Kc0ow.png" /><figcaption>AWS Console Subnets</figcaption></figure><p>Check for ECS Cluster:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*2TKfoGoYbfwM-z78_kGB-Q.png" /></figure><p><strong>Step 7) Destroy!!!</strong></p><p>Make sure to destroy your work. You don’t want to get billed for something you’re not using anymore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d9hFINWvKPOlLK3BoQA7ZA.png" /></figure><p>Above shows how to use Docker and Terraform to pull CentOS. I hope you found it easy to understand and easy to follow!</p><p><strong><em>Connecting:</em></strong></p><p>LinkedIn: <a href="https://www.linkedin.com/in/shawn-shifflett-59b73716b/">https://www.linkedin.com/in/shawn-shifflett-59b73716b/</a></p><p>GitHub: <a href="https://github.com/Shawn-Shifflett">Shawn-Shifflett (github.com)</a></p><p>Email: Shifflettko@battlers.ab.edu</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f55cf2d322bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create a Custom Terraform Module]]></title>
            <link>https://medium.com/@shifflettko/create-a-custom-terraform-module-571b8a328e40?source=rss-65caae5a9499------2</link>
            <guid isPermaLink="false">https://medium.com/p/571b8a328e40</guid>
            <category><![CDATA[modules]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Kashawn Shifflett]]></dc:creator>
            <pubDate>Wed, 24 Aug 2022 02:47:33 GMT</pubDate>
            <atom:updated>2022-08-24T02:58:53.020Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zgjRcNU3Nala1Bz_" /><figcaption>Photo by <a href="https://unsplash.com/@kaleidico?utm_source=medium&amp;utm_medium=referral">Kaleidico</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This project will guide you through how to setup a Terraform Module with <strong>Parent</strong> and <strong>Child </strong>resources.</p><p><strong><em>Prerequisite:</em></strong></p><ul><li>AWS Console Account</li><li>MFA Code</li><li>Cloud9 (or some type of IDE)</li><li>Not required but <strong>VERY</strong> helpful: <a href="https://www.terraform.io/docs">https://www.terraform.io/docs</a></li></ul><p><strong>Goals for this project:</strong></p><ul><li>Fork and clone this repo locally with the <a href="http://ec2.tf/">ec2.tf</a> template as a starting point to create the ec2 : <a href="https://github.com/LevelUpInTech/terraformec2.git">https://github.com/LevelUpInTech/terraformec2.git</a></li><li>Create a custom module for ec2 out of the resource block that you can use as repeatable infrastructure</li><li>Push the new created module and the <a href="http://ec2.tf/">ec2.tf</a> file to your repo!</li></ul><p><strong>What is Terraform?</strong> Terraform is an open-source, infrastructure as code, software tool. Terraform has what is called a Parent (usually known as Root) and a Child resource. The two work together. Child is created inside the Parent, not vice versa (duh!).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*jJW5yFCN4r7_DhA1hTB3_w.png" /><figcaption>Parent and Child relationship</figcaption></figure><p><strong>Step 1) Setup </strong>a Cloud9 Environment. Navigate to Cloud9 in the search bar on the AWS Console. Once on the Environment page click Create Environment. On the following page name the environment and leave a description if you’d like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YjLzaUF9Oq9p8LaLNkV4sg.png" /><figcaption>Description of what an environment would look like once created</figcaption></figure><p><strong>Step 2) </strong>Now that the environment is created it’s <strong>time to get to work! </strong>We need to Fork and Clone the repo ec2.tf. We can access this from; <a href="https://github.com/LevelUpInTech/terraformec2.git">https://github.com/LevelUpInTech/terraformec2.git</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9p7rJPnDb7EaHXtVIs4Wrw.png" /></figure><p>On GitHub in the top right there will be a Fork button click that and create your new fork. What’s a Fork? A Fork is a copy of a repository. You can modify any code you want without changing any of the original code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d38e617ffcbb2ed5449aa1aa8d0fe2fd/href">https://medium.com/media/d38e617ffcbb2ed5449aa1aa8d0fe2fd/href</a></iframe><p>To Clone code we need to head to our environment&#39;s terminal.</p><p>Here we will enter git clone &lt;repo link&gt;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nHtZGh6t_7GHLEn12rmWgg.png" /></figure><p>Everything was cloned to the environment!</p><p><strong>Step 3) Make a directory. </strong>Now that we’ve cloned over everything we needed to we should make a directory using mkdir &lt;name&gt;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qkycgk7Eqcl6JMejZltt4g.png" /></figure><p>As shown above we need to add some files to the new directory. Add files by touch &lt;fileName&gt;. For this project we needed a main.tf, var.tf, output.tf and a prov.tf.</p><p>We can verify that the touch &lt;fileName&gt; worked by looking under our directory on the left side of our environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*Lq-IvXRkrfmAhY1rODrviw.png" /></figure><p>Above shows four files that we just added ending with the .tf tag stating that it’s a Terraform file. However, you may wonder why the ec2.tf file is slightly outside. That’s the file we Forked and Cloned over, this file isn’t in our directory at the moment.</p><p><strong>Step 4) Editing. </strong>Since we now have files under our new directory it’s time to start making some changes. We will modify code from that file we forked earlier (ec2.tf).</p><p>We will open our var.tf file and add the following code;</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/271a6607b7181ee5472719ebe0ae198e/href">https://medium.com/media/271a6607b7181ee5472719ebe0ae198e/href</a></iframe><p>Wondering where that default ami came from? Jump over to your AWS Console. Once on there go to the EC2 section and begin to create a new EC2. Here right under the Machine Image section there will be an AMI ID. Copy that and paste it into the default ami.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*fGDgNMfD7HGiJBRbOC12LQ.png" /></figure><p>We will then open up porv.tf. Here we will copy the provider section from the ec2.tf and paste it in our prov.tf.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/caadcff457a3bc736701a4d22e7c6319/href">https://medium.com/media/caadcff457a3bc736701a4d22e7c6319/href</a></iframe><p>Notice anything different ? Instead of what ec2.tf showed region = &quot;us-west-2 we now have region = var.region. That’s because of the var.tf above. The var.tf code switches from hardcoding to variables, making things organized (at least to me).</p><p>Now we will go ahead and open up the main.tf. Similar to prov.tf we will copy over some code from the original ec2.tf code. But, this time we will copy the resource and modify it some.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/50e9ab945f0cdf975d3aba1a71478de4/href">https://medium.com/media/50e9ab945f0cdf975d3aba1a71478de4/href</a></iframe><p>Once again, we see how var.tf comes in handy! Can you spot the modifications that were made from the original ec2.tf code ?</p><p>If you’re confused, the changes are ami = var.ami_id and instance_type = var.int.</p><p>Finally we want to go over to the output.tf</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89dcd457d84dc18ff67ed09d1e68053f/href">https://medium.com/media/89dcd457d84dc18ff67ed09d1e68053f/href</a></iframe><p>Not like the other files we changed, output.tf doesn’t use var.tf. However, output.tf is very useful so we can see/add information about what is going on. output.tf is like little side notes.</p><p><strong>Step 5) Create Child resource. </strong>In the Parent resource make another directory using mkdir &lt;childName&gt;. Then cd into &lt;childName&gt;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*WAWm3XIDU-HGgVIf7okI0Q.png" /></figure><p>Here we will make a module.tf file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5da13b9af24da61550c5baf9479745b3/href">https://medium.com/media/5da13b9af24da61550c5baf9479745b3/href</a></iframe><p>With the module.tf make sure you’re source is correct.</p><p><strong>Step 6) PLAN, APPLY, DESTROY! </strong>Here is the real test. We will find out here if everything is working together or not.</p><p>Very first step is to Terraform init</p><p>To make things look nice you can add a Terraform fmt</p><p>To validate code add a Terraform validate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*r3EgYCG2MPSRHuDMzcCuvw.png" /></figure><p>GREEN IS GOOD!</p><p>Now to the “nail biter”, we don’t need to stress we know what we’re doing!</p><p>First we need to Plan.</p><p>Use Terraform Plan. This doesn’t actually do much other than give an overview of what <strong>SHOULD </strong>happen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*ZQWk3HCVDy8azcB9MNX5Nw.png" /><figcaption>Results from Terraform Plan</figcaption></figure><p>Next we need Terraform Apply. This is where the actual deployment is ran.</p><p>Midway through the Apply stage you will be requested to enter YES/NO. Entering Yes will continue the deployment. You can bypass this step by adding --auto-approve at the end of your Terraform Apply. This is not best practice so we will just enter Yes when prompt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RuTlsAU_-xZyjKZRG_jx_A.png" /><figcaption>Result from Apply</figcaption></figure><p>Apply deployed successfully!</p><p>We can double check to make sure. On the AWS Console check the Instances and you will see our deployment ran correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KCtkG8uclLCpqgZa9Zwh3Q.png" /><figcaption>Result on AWS Console from Terraform Apply</figcaption></figure><p>Now <strong>DESTROY</strong>! Always make sure to destroy when you’re done.</p><p>To destroy enter Terraform Destroy in the environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*IJFadLKwU2NiDuLldAY1PA.png" /><figcaption>Results from Terraform Destroy</figcaption></figure><p>Above shows how to create a custom terraform module. I hope you found it easy to understand and easy to follow!</p><p><strong><em>Connecting:</em></strong></p><p>LinkedIn: <a href="https://www.linkedin.com/in/shawn-shifflett-59b73716b/">https://www.linkedin.com/in/shawn-shifflett-59b73716b/</a></p><p>GitHub: <a href="https://github.com/Shawn-Shifflett">Shawn-Shifflett (github.com)</a></p><p>Email: Shifflettko@battlers.ab.edu</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=571b8a328e40" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Use Lambda and API Gateway to send messages to SQS]]></title>
            <link>https://medium.com/@shifflettko/use-lambda-and-api-gateway-to-send-messages-to-sqs-43480b064afe?source=rss-65caae5a9499------2</link>
            <guid isPermaLink="false">https://medium.com/p/43480b064afe</guid>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[messaging]]></category>
            <dc:creator><![CDATA[Kashawn Shifflett]]></dc:creator>
            <pubDate>Tue, 19 Jul 2022 00:23:32 GMT</pubDate>
            <atom:updated>2022-08-27T20:11:24.835Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Db0SiqnLpAn3GO4Z" /><figcaption>Photo by <a href="https://unsplash.com/@brett_jordan?utm_source=medium&amp;utm_medium=referral">Brett Jordan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This project will guide you through how to setup a Lambda function to send messages to SQS, while using API Gateway as the trigger.</p><p><strong><em>Prerequisite:</em></strong></p><ul><li>AWS Console Account</li><li>MFA Code</li><li>Cloud9 (or some type of IDE)</li></ul><p><strong>Goals for this project:</strong></p><ul><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></ul><p><strong>Step 1) Setup </strong>a Cloud9 Environment. Navigate to Cloud9 in the search bar on the AWS Console. Once on the Environment page click Create Environment. On the following page name the environment and leave a description if you’d like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*tjYHv6hUiCF9A4Qw6Tf4XQ.png" /></figure><p>Click Next Step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*7yIKkFxnGImvJ4zjmXKZfw.png" /></figure><p>If you’re creating a new environment your start up screen would look a little different. Mine has files I’ve been working on. On the left side in the blue column if you right click on your mouse you can create new files. Make sure to save your file under the correct program. For example, with python the files must end with .py.</p><p><strong>Step 2) Create </strong>a Standard SQS<strong>. </strong>I did this in Cloud9, however you can create a SQS in the AWS Console too.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/22d501918c056f6784128f2155bc1c4c/href">https://medium.com/media/22d501918c056f6784128f2155bc1c4c/href</a></iframe><p>Since we’re working with <strong>boto</strong>, import boto3 is required. Above will create a SQS with the name week15queue.</p><p>We can see that the SQS was successfully created by the print statement underneath. Just to be sure we can check in the AWS Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0kLJek9pv0vyuVJmuGqgyQ.png" /></figure><p>SQS was created successfully!</p><p><strong>Step 3) Create </strong>a Lambda function. This project required for the runtime to be Python 3.7 or higher.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*9CJbO0jopjpn9NxwMWHPnw.png" /></figure><p>Click Author from scratch. Name the function what you would like, here it’s named week15LambdafunctionProj. As required a runtime Python 3.7 or higher is selected. Scroll down and in the bottom right there will be a Create function button, click that and the function will begin to create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*b9MQMfDDUbt0K5-C2QfXhQ.png" /></figure><p>Once created you’ll see the above screen.</p><p>Permission. Permission. Permission. Make sure the correct Permissions are being used or you may have issues later and have to backtrack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*lY45ICXBXHsYUhPErn-t4g.png" /></figure><p>On the Lambda Function page click Configuration. Inside there will be a Permissions tab. Inside the tab there will be a link, click it, and add the necessary permissions.</p><p>This project is working with SQS so the only permission that is necessary is AmazonSQSFullAccess.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*3EB055Hl9yuS89WnyyttxA.png" /></figure><p>Attach the policy and head back to the Lambda function dashboard.</p><p><strong>Step 4) Write</strong> to SQS from the Lambda function. Back on the Lambda function dashboard click Code. Here is where the Lambda function will write to the SQS.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/09d10d59faf7c8ab5a20534491bee229/href">https://medium.com/media/09d10d59faf7c8ab5a20534491bee229/href</a></iframe><p>On the Lambda function page there will be a Deploy button, this is the same as saving a file. When you first Deploy code you will be taken to a page where you have to name the saved deployment. If it’s not you’re first time saving this code you wont be directed to this page, it’ll just save for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*CPpDcKuxp4e0m4S5VT96dg.png" /></figure><p>Once you’ve entered a name go back and right next to Deploy there will be a Test button. Click Test. If everything is correct you’ll see the following;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*MGFKMh3867GV8PwpUyjMhA.png" /></figure><p>There’s a 200 message which means there was a successful run. We can also see the message that was entered through the code.</p><p><strong>Step 5) Create </strong>API Gateway<strong> </strong>trigger. Next we’re required to add an API Gateway to the Lambda function that was created. On the Lambda function dashboard on the left there will be an Add trigger button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*J04JFNLuGJ6zvbLN_nOSUA.png" /></figure><p>Click Add trigger, and add the appropriate trigger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*D4-x2Wrf53RsfO6E9YcVRQ.png" /></figure><p>Once you add the appropriate trigger (for this project API Gateway) make sure the type is HTTP API and that the Security is set to Open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*-9AiYVVIdPG3JzHGiEzE5Q.png" /></figure><p>Click Add and you’ve successfully added a trigger to you Lambda function.</p><p>We can see the successful trigger by clicking Configuration on the Lambda function dashboard. In the Configuration tab, click Triggers.</p><p>Here the API Gateway added will have a link. To test if the SQS, Lambda function and API Gateway are all working together click on the link displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*_5ntV-Ys30EkKc8PUgibBA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*aKFYMLptZEvk2rKqi77LRA.png" /></figure><p>The three are working like we predicted. This confirms a successful API Gateway connection.</p><p><strong>Step 6) Check </strong>SQS. Head to the SQS dashboard to verify the Lambda function sent messages to the SQS like required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*zRjoc79d_FMciWzIM-ZWPw.png" /></figure><p>Here there’s 3 Messages available. That’s a good sign.</p><p>Click Send and receive messages. Scroll down to Receive messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iZQAv0Vma5mFIf_KDOKI0g.png" /></figure><p>Click Poll for messages, this will collect all messages that were sent through the Lambda function to SQS. Inside of Poll for messages there will be a number of message links (in this case there’s 3).</p><p>Click on one of the message links.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*S4Auga7oNoKhHlu1e4DKNw.png" /></figure><p>We can verify that the Lambda function, API Gateway and SQS are successfully working together.</p><p>Above shows how to get a Lambda function to send messages to SQS. I hope you found it easy to understand and easy to follow!</p><p><strong><em>Connecting:</em></strong></p><p>LinkedIn: <a href="https://www.linkedin.com/in/shawn-shifflett-59b73716b/">https://www.linkedin.com/in/shawn-shifflett-59b73716b/</a></p><p>GitHub: <a href="https://github.com/Shawn-Shifflett">Shawn-Shifflett (github.com)</a></p><p>Email: Shifflettko@battlers.ab.edu</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43480b064afe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a DynamoDB table with Python boto3]]></title>
            <link>https://medium.com/@shifflettko/creating-a-dynamodb-table-with-python-boto3-3533e5889bdc?source=rss-65caae5a9499------2</link>
            <guid isPermaLink="false">https://medium.com/p/3533e5889bdc</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[music]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[dynamodb]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Kashawn Shifflett]]></dc:creator>
            <pubDate>Mon, 11 Jul 2022 02:32:03 GMT</pubDate>
            <atom:updated>2022-08-27T20:30:40.465Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rrKbGseQUxTSmWql" /><figcaption>Photo by <a href="https://unsplash.com/@lokoslens?utm_source=medium&amp;utm_medium=referral">Zachary Smith</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This project will guide you through creating a DynamoDB table with Python boto3! For this project we need input for the table, so I used my favorite musicians and their type of music genre. I hope in the following I can educate you on how to create a DynamoDB table <strong>AND </strong>some <strong>great </strong>music!</p><p><strong><em>Prerequisite:</em></strong></p><ul><li>AWS Console Account</li><li>MFA Code</li><li>Cloud9 (or some type of IDE)</li></ul><p><strong>Goals for this project:</strong></p><ul><li>Create a DynamoDB table for something of your choosing (e.g. movies, food, games).</li><li>Using the Gist (<a href="https://gist.github.com/zaireali649/0ec6b90155120cf508223788b7b86efc">https://gist.github.com/zaireali649/0ec6b90155120cf508223788b7b86efc</a>) as a starting point, use boto3 and Python to add 10 or more items to the table.</li><li>Use boto3 and Python to scan the DynamoDB table.</li></ul><p><strong>Step 1) <em>Create an environment</em></strong> in AWS Cloud9 (this is the IDE I used). Once on the Cloud9 Environment navigate to Create environment .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*gqIpCbJ6-U4q7v507nSwwA.png" /></figure><p>Name the environment what you would like then click Next step. On this page (Configure settings) leave everything as default and click Next step. Here we will be on the Review page. Click Create environment and the environment will be created.</p><p><strong>Step 2) <em>Setting up a file</em></strong>. The environment will load up and on the left side there will be a blue column. Right click within the blue column and click New File.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*mPg-UwLNmNXPYQSpzpHTAw.png" /></figure><p>Name the file whatever you’d like but make sure to add .py since we’re working with Python.</p><p><strong>Step 3) <em>Time to code</em></strong>! Here we will create the DynamoDB table. HASH will be our partition key. RANGE will be our sort key.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/67860e7328e870b9f58d570c35089f10/href">https://medium.com/media/67860e7328e870b9f58d570c35089f10/href</a></iframe><p>Next run the code by either clicking the Run on the top or entering nameOfFile.py in the terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*exOub_0Lt2-vcwFH2i1VYw.png" /></figure><p>The above should print out if the table is created correctly.</p><p><strong>Step 4) <em>Connect </em></strong>the table with the IDE.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/362a2d47faed2de7f8e2eb4a100d535a/href">https://medium.com/media/362a2d47faed2de7f8e2eb4a100d535a/href</a></iframe><p>Here I * out the key id and access key. You never want to give up your credentials. However, key id will be the email to sign into AWS. Access key will be the password to sign in.</p><p><strong>Step 5)</strong> <strong><em>Adding data</em></strong> to the table!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/86d3cbfadf111aee1c15f594197c222b/href">https://medium.com/media/86d3cbfadf111aee1c15f594197c222b/href</a></iframe><p>Here we want to make sure to connect using; dbTable = boto3.resource(&quot;dynamodb&quot;, region_name = &#39;us-east-1&#39;).</p><p>Next make sure to select the right table using; tableName = dbTABLE.Table(&#39;musicians&#39;).</p><p>For this project we were asked to add 10 elements of our liking to the DynamoDB table. The with tableName.batch_writer()as batch: section is how to enter elements to the table. Again, my table is about my favorite musicians and their genre.</p><p><strong>Step 6) </strong>Time to <strong><em>scan</em></strong> the file!</p><p>Scanning is pretty simple, use; tableScan = tableName.scan(). Next grab what you’re wanting to scan for, tableScan[&#39;Items&#39;].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YYlKe3RH8EE08YSSIDRLgg.png" /></figure><p>Above is what should print. Code will print/scan out the input added in a format sectioning off each element.</p><p>This is how you create a DynamoDB table using python boto3. I hope you found it easy to understand and easy to follow. Now it’s your turn to create some tables! Make sure to check those musicians out if you haven’t already!</p><p><strong><em>Connecting:</em></strong></p><p>LinkedIn: <a href="https://www.linkedin.com/in/shawn-shifflett-59b73716b/">https://www.linkedin.com/in/shawn-shifflett-59b73716b/</a></p><p>GitHub: <a href="https://github.com/Shawn-Shifflett">Shawn-Shifflett (github.com)</a></p><p>Email: Shifflettko@battlers.ab.edu</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3533e5889bdc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a 3 Tier Architecture in AWS]]></title>
            <link>https://medium.com/@shifflettko/creating-a-3-tier-architecture-in-aws-53495d4c87f7?source=rss-65caae5a9499------2</link>
            <guid isPermaLink="false">https://medium.com/p/53495d4c87f7</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[linkedin]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Kashawn Shifflett]]></dc:creator>
            <pubDate>Fri, 10 Jun 2022 03:57:02 GMT</pubDate>
            <atom:updated>2022-06-10T03:57:02.252Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*zgYMRXgen0tZ-8LEMFIubw.png" /></figure><p>What is <strong>3 Tier Architecture</strong>? 3 Tier Architecture is a software application architecture that organizes applications into three logical and physical computing tiers.</p><p>The tiers for this project are:</p><p>1) Web Tier</p><p>2) Application (App) Tier</p><p>3) Database (DB) Tier .</p><p>A real world example of 3 Tier Architecture could be a 3 piece suit. You have your pants, vest and jacket. Yes, you can purchase/wear all these separate, but when used together you look <em>good</em>!</p><p><strong><em>Prerequisite:</em></strong></p><ul><li>AWS Console Account</li><li>MFA Code</li><li>Command Line (CLI)</li><li>Diagram Website, <a href="https://www.diagrams.net/">https://www.diagrams.net/</a> (optional, but <strong><em>VERY</em></strong> helpful)</li></ul><p><strong>Goals for this project:</strong></p><ul><li>Create a VPC</li><li>Create 2 public (Web)/4 private subnets(2 in App, 2 in DB) and place them in their correct tier</li><li>Make sure there’s 2 Availability Zones (AZ)</li><li>Create a Route Table, Internet Gateway, NAT Gateway and RDS</li><li>Create EC2 Instances with correct Auto-Scaling</li><li>Verify your tiers are connected and running successfully</li></ul><p><strong>Step 1) </strong>Create a <strong>VPC</strong>. From your AWS Dashboard navigate to the search bar up top. Enter VPC. Once on the VPC Dashboard look on your left and click Your VPC. You will be routed to a page that will have a Create VPC in the top right. Click that and begin modifying your VPC how you would like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*khAK-jfLiDvp4k2KJATlGA.png" /></figure><p>Here I named the VPC Tier3-project-Vpc. In IPv4 CIDR I set it to 10.0.0.0/16. Leave everything else default and click Create VPC.</p><p><strong>Step 2) </strong>Create<strong> Subnet. </strong>Back on the VPC Dashboard that we’ve seen before look on the left in the column and click Subnets. On this page we will see a Create Subnet in the top right. Click that. Here we will have to enter the correct VPC that’s going to be used. Make sure we’re using the <strong>correct</strong> VPC, I’ve messed up a handful of times by not entering the correct VPC, it’s easier than it may seem.</p><p>Once we’ve made sure we put the correct VPC in go down to Subnet settings. Enter the info you would like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*7bEJ_7yJBiOorhlhKVxo7w.png" /></figure><p>Remember that we need 2 public subnets in Web Tier. And 2 private subnets in Application and DB Tier.</p><p>First, we need to get the public subnets together. Above is the info that we need to create 1 public subnet. To create a second subnet click Add New Subnet, which is right under the Remove button. The changes from public-web-subnet-1 to public-web-subnet-2 is of course the number 1 and 2 in the name of our subnet.</p><p>We also want to change the AZ to be different than public-web-subnet-1. So when we click the dropdown menu for AZ we want to choose us-east-1b which we can see is a different AZ than our public-web-subnet-1.</p><p>And finally the IPv4 will have to be different. public-web-subnet-1 has an Ipv4 of 10.0.1.0/24, we want public-web-subnet-2 to have an IPv4 of 10.0.2.0/24. This would look like;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*i-UDN59li-ae1Ok9wO4uFQ.png" /></figure><p>We continue this with our 4 private subnets by clicking Add New Subnet. The difference would be the name; private-app-subnet-1&amp; private-app-subnet-2 for the App Tier. Name: private-db-sunet-1&amp; private-db-subnet-2 for the DB Tier.</p><p>We’ll set all subnet-1 to the AZ of us-east-1a and all the subnet-2 to the AZ of us-east-1b.</p><p>Can’t forget the IPv4. What’s that look like? Remember we left off at public-web-subnet-2 with the IPv4 of 10.0.2.0/24. So the next subnet private-app-subnet-1 will have an IPv4 of 10.0.3.0/24. Continue this increment of 1 until all subnets have an IPv4, which will be private-db-subnet-2 which will have the IPv4 of 10.0.6.0/24.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CYfwkCJkhYSlrVvkzejffg.png" /></figure><p>We’ve created all our subnets!</p><p><strong>Step 3)</strong> Create <strong>Route Table. </strong>Back in the VPC Dashboard on the left we’ll see Route Table. Click on it. Then click Create Route Table. Add a name to the Route Table. Enter the VPC. Click Create Route Table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*_sNL1gwv4B1TgVyc0XQ5qg.png" /></figure><p>We’ll see a successful creation of the Route Table (public). The private subnets will have a private Route Table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HzJ_y1j8RIN8q5Ws81Dt6g.png" /></figure><p>Not done yet! We must add the subnets to the table. Both public and private Route Tables will do this the same way. Find your way inside the Route Table by clicking on the name. Once inside click subnet association. Add the correct subnets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Gf6yJkzYgR1aao1T5on2A.png" /></figure><p>A successful subnet association will look like the following;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zG579uFKMUqDZ9SMMOYjgw.png" /></figure><p><strong>Step 4) </strong>Create <strong>Internet Gateway</strong>. Again, back on the VPC Dashboard click on Internet Gateway. Once inside click Create Internet Gateway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*hsPnr3IMs8u0mCo00ZKlJw.png" /></figure><p>Next we must click on the Gateway’s name. Click Action and a dropdown menu will appear. Click Attach to VPC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*spZ9cTpMhRP7vwkU6MekLw.png" /></figure><p>Once on this page another dropdown menu will occur, click the VPC and the Internet Gateway is now attached to our VPC.</p><p><strong>Step 5) </strong>Create <strong>NAT Gateway</strong>. On the VPC Dashboard, on the left you’ll see NAT Gateway. Click on it. Once on this page click Create NAT Gateway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*N3oXyiMuRHPHcyYKZd9c2Q.png" /></figure><p>Enter the info you’d like. Before we click create we want to Allocate Elastic IP. This will give and IP ID. Now we may click Create NAT Gateway.</p><p>Once the NAT Gateway is created go back to Route Table. Click on the table and then Edit Rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*GujzQgo0lIw9meRJH9Ro_g.png" /></figure><p>Above we are giving access to the Internet Gateway.</p><p><strong>Step 6) </strong>Create<strong> EC2 Instances. </strong>Now we want to navigate to theEC2 section of AWS. We want to set up an Instance like we would normally. Give the EC2 a name, an AMI (free tier),an Instance type of t2.micro and a key pair.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*Us_8_KgzxNcFzh56x0ydMA.png" /></figure><p>Once we entered the key pair we should see Network Settings. Here we want to Create Security Group. We give the group a name and we add our VPC. Next click Inbound Security group rules. Enter the following;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*mYLMv1nPjN3JipTLmP-6cg.png" /></figure><p>Now scroll down until you see Advanced Settings. In Advanced Settings find User Data. Once you’ve found User Data we want to enter the following;</p><pre>#!/bin/bash<br>yum update -y<br>yum install -y httpd<br>systemctl start httpd<br>systemctl enable https<br>echo &quot;&lt;html&gt;&lt;body&gt;&lt;h1&gt;KaShawn&#39;s Week 9 Project on 3 Tier&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;&quot; &gt; /var/www/html/index.html</pre><p>Finally click Launch template. Head over to Auto-Scaling Groups (ASG).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*mijarw7LW0-6WWoxOlJLHA.png" /></figure><p>Above, we want to find the name of our EC2 we just created. Click Next. Enter the VPC and add the AZs and Subnets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*Nz42kZNuII56gtgw04v9_Q.png" /></figure><p>As we continue to modify our ASG the way we want we should see a screen looking like;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*qxRlQ8ssdppH2zM0uN_Ahw.png" /></figure><p>Here we create our desire amount of EC2 Instances that we want. This project ask for a minimum of 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qjzdlLDCJcNlGmMHDxaaWQ.png" /></figure><p>We see this is created successfully, with the desired, minimum and maximum amount. We need to check and see if our Instance actually works. Click on the name, and copy the Public IPv4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*YO8aYgBMGjWMc8O9xfMGFg.png" /></figure><p>The Instances is working correctly!</p><p>Now we must create a private EC2 Instance. This will be very similar to our Public EC2. However, in the Security Group we want to make our Type ssh and custom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*WhQwydR4cvhCsHYgibFaLw.png" /></figure><p>We also want to create a private ASG. Here we add the VPC and our private App subnets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*pxq9BK4m1V5xpXWTm-aeUg.png" /></figure><p><strong>Step 7) </strong>Create <strong>RDS</strong>. Find your way to RDS and click Subnet Groups on the left. In here we want to connect the VPC, add the correct AZs and add the fitting subnets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*K7IQsYH5ct97z9Z7t4ENbA.png" /></figure><p>Once RDS is completed we want to go into the Security Groups. Here we need to click on Actions, click Inbound Rules and change the source to our App Tier.</p><p><strong>Step 8) </strong>Create a <strong>Database</strong>. Back on the RDS Dashboard, click Create database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*MHYHLtZKXpy-VoS1DrRLPg.png" /></figure><p>Keep the method on Standard. Here select MySQL. In Settings we’ll be prompt to create a username and a password. So do that and <strong>remember </strong>them.</p><p>In Connectivity we want to click the VPC. Create new when it comes to VPC security, and give it a name.</p><p>Now we want to give the RDS some security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*xsBLSdVc25oeci0oiGiy7A.png" /></figure><p>Click on the link under VPC security group. Add the App Tier to add commutation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*M4WOYz5UPnOLcX7ZZjHayw.png" /></figure><p><strong>Step 9) CLI</strong></p><p>Ssh to the Public EC2 in the CLI.</p><pre>ssh -i &lt;key-pair-name.pem&gt; ec2-user@&lt;public-ipv4&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FZvohA9bp-ZrDn_Dh-O3yg.png" /></figure><p>The public EC2 is working! Next we want to connect to out Private EC2, using;</p><pre>ssh -A ec2-user@&lt;private-ipv4&gt;</pre><p>Now we want to install MariaDB to access our database(MySQL), using;</p><pre>sudo yum install mariadb</pre><p>This may take some time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*Kom3qVd9Rh3gQkjBNYRtiw.png" /></figure><p>Looks good! Go into the Database and find the Endpoint &amp; port within the Connectively &amp; security portion. Copy it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*_vkAKnPmXr7eb-A63LO6pA.png" /></figure><p>In the CLI we’re going to use the endpoint, our Port which is 3306 and our username from earlier, admin to connect.</p><pre>mysql -h &lt;endpoin&gt; -P 3306 -u &lt;admin&gt; -p</pre><p>Enter that password from earlier (should’ve saved it or remembered it).And we’re connected to MariaDB.</p><p>This is how you create a 3 Tier Architecture in AWS. A longer/challenging project. But it’s done! We covered how to create VPC, created subnets and AZs, how to connect Route Tables, NAT Gateways, Internet Gateways and more. I hope you enjoyed this project!</p><p><strong>DON’T</strong> be like me and forget to <strong>delete </strong>your 3 Tier Architecture. AWS will <strong>bill<em> </em></strong>you and that’s no fun. <strong>DELETE </strong>your Tier when finished!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53495d4c87f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating tables in DynamoDB]]></title>
            <link>https://medium.com/@shifflettko/creating-tables-in-dynamodb-507532f070e2?source=rss-65caae5a9499------2</link>
            <guid isPermaLink="false">https://medium.com/p/507532f070e2</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[dynamodb]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Kashawn Shifflett]]></dc:creator>
            <pubDate>Fri, 03 Jun 2022 03:36:31 GMT</pubDate>
            <atom:updated>2022-06-03T03:36:31.524Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z7W43k4HIu06ZpwI" /><figcaption>Photo by <a href="https://unsplash.com/@uxstore?utm_source=medium&amp;utm_medium=referral">UX Store</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>What is <strong>DynamoDB</strong>? DynamoDB is a fully managed <strong>NoSQL</strong> (a unique database, not working with your normal database, such as MySQL) database service that supports key values.</p><p><strong><em>Prerequisite:</em></strong></p><ul><li>AWS Console Account</li><li>MFA Code</li><li>Command Line (CLI)</li></ul><p><strong>Goals for this project:</strong></p><ul><li>Create DynamoDB table of something of your choosing</li><li>Add at least 10 items to the DynamoDB table</li><li>Create t2.micro EC2 instance</li><li>Give privilege using IAM roles</li><li>Scan the table using a CLI</li><li>Confirm you can’t write an item to the DynamoDB table</li></ul><p><strong>Step 1</strong>: <strong>Create </strong>a DynamoDB table. On the AWS Console head to DynamoDB by clicking on Database then scroll down to DynamoDB. Once you click on DynamoDB you’ll see a page like the following;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*1SOs1xZg6JDmPRIn65p22Q.png" /></figure><p>Click Create table. Once in you click Create tables you’ll be prompt to a page to enter some information about how you want to set up your table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*zwHv1APwJLGdg5wwN03fow.png" /></figure><p>Here I named my table week8-project, set a partition key using String (word) and set a Sort key using Number. If you’re comfortable with all the information scroll down and click the Create table button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pHLz-r3uBFVC3BbLc2Zgig.png" /></figure><p>If all required information is entered you’ll get a created successfully notification. You’ll also see that the status is listed as Active. <strong>Step 1 </strong>is now complete, we’ve created a DynamoDB table.</p><p><strong>Step 2</strong>: <strong>Enter items</strong>. Entering items is just inserting data to your table. To do so click on week8-project under Name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HLrs7kCqIpaJSEQqTXUGRA.png" /></figure><p>Find your way to Action, a dropdown menu will be provided and click Create item. For this project we were requested to enter at least 10 items with a topic of our choosing. I decided to create a table about NBA teams and how many championships the team has won. So, I set the partition key to teams and I set the sort key to rings (championships).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*ts0epKJstu_kvI1mA0tbBw.png" /></figure><p>Once all the items/data is entered click Items returned to see your items in your table (like above). <strong>Step 2</strong> is now complete, we’ve created items.</p><p><strong>Step 3</strong>: <strong>Create </strong>t2.micro EC2 instance. Navigate to EC2 and once inside you’ll find a Launch instance option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2jHiMbnxvXDJv5TiaXfsOw.png" /></figure><p>Click Launch instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*Yltzor1pMDS4JSemAkjAfA.png" /></figure><p>Make sure to name your EC2 instance something that’s relative to your current project. Here I named it week8-project-EC2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t5tC1vr7IER0ehWHi3jQsQ.png" /></figure><p>Now here is where we make our EC2 a t2.micro. Fill out any additional information that is required and click Create instance button at the bottom. <strong>Step 3 </strong>is now complete, we’ve create an EC2 instance that is using t2.micro as its instance type<strong>.</strong></p><p><strong>Step 4</strong>: <strong>Give privilege</strong> using IAM roles. Navigate to the IAM section of AWS. Once inside look on the left and click Roles. On the top right there will be a Create role button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eS_Md9V_BvugJCv6ThwS7Q.png" /></figure><p>Here we want to allow our role to read, nothing else. And give it to our EC2 instance that we just created. So above we want to make sure to click EC2 under Use Case. Click Next. Here is where we actually allow read access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VmniyxROTj32pLZ3NvsUwA.png" /></figure><p>In the search bar enter AmazonDynamoDBReadOnlyAccess. This will allow us to create a role where we can <strong>ONLY </strong>read.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rb0BQw9FE8ZoIjY_WErOVQ.png" /></figure><p>Enter what you want to name your role and at the bottom click create role. Now we created a role it means nothing without placing it somewhere.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hacfAsTDK0R-2kqjcQFelg.png" /></figure><p>Back in our EC2 instance, click the name of the instance. Navigate to Action and in the dropdown menu you’ll see Security. Hover over that and you’ll see the Modify IAM role option. Click that. Once clicked you’ll see the following;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WGcKP3v_l1HRIgAeXtJA7w.png" /></figure><p>Insert the name of the role you created and click Update IAM role. Now we gave or EC2 instance the AmazonDynamoDBReadOnlyAccess (read only) role. <strong>Step 4</strong> is now complete, we gave read access to our EC2 instance.</p><p><strong>Step 5</strong>: <strong>Scan</strong> the CLI. Scan is printing/reading our table that we previously created in the AWS Console but in the CLI. Here we have to find your access commands to enter the CLI. Once you have access to the CLI you should get the following;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FBTzX5qbnbqCeHm18e6pMg.png" /></figure><p>Here we want to run the aws dynamodb scan --table-name wee8-project --region us-east-1 command. This will output the following;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ndSW4DrUhbdTJaTVph3MqQ.png" /></figure><p>Everything looks good! <strong>Step 5</strong> is complete, we’ve scanned our CLI.</p><p><strong>Step 6</strong>: <strong>Confirm </strong>we <strong>can’t write</strong> any items to out DynamoDB. Still in the CLI we want to write the command aws dynamodb put-item --table-name week8-project --item {&quot;teams&quot;:{&quot;S&quot;:&quot;Suns&quot;}, &quot;rings&quot;:{&quot;N&quot;:&quot;0&quot;}} --region us-east-1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V3f38cJIVUnykdC-cTvDJw.png" /></figure><p>We get an error message which is exactly what we want for this step. <strong>Step 6 </strong>is now complete, we’ve confirmed that we can’t write items into our DynamoDB table.</p><p>This is how you create a DynamoDB table with items. We also learned how/what Scan is with the CLI and we learned how to restrict access to write into the table.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=507532f070e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Auto Scale within CloudFormation]]></title>
            <link>https://medium.com/@shifflettko/how-to-auto-scale-within-cloudformation-48265d8349b8?source=rss-65caae5a9499------2</link>
            <guid isPermaLink="false">https://medium.com/p/48265d8349b8</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[cloudformation]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Kashawn Shifflett]]></dc:creator>
            <pubDate>Wed, 25 May 2022 01:10:06 GMT</pubDate>
            <atom:updated>2022-05-25T01:14:52.982Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UMJP9zi0qM2Dz7Y6" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>What is <strong>CloudFormation</strong>? CloudFormation is a service that lets developers configure and run groups of code. CloudFormation is much quicker than a developer manually entering all the info themselves.</p><p><strong><em>Prerequisite:</em></strong></p><ul><li>AWS account</li><li>MFA Code</li><li>Visual Studio Code (or any other code editor you like)</li></ul><p><strong>Goals for this project:</strong></p><ul><li>Create Auto Scaling Group using t2.micro</li><li>Have the Auto Scaling Group expand over two Availability Zones (AZ)</li><li>Install Apache at boot up</li></ul><p><strong>Step 1:</strong> We need to <strong>build </strong>our template. To find examples of templates: <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/sample-templates-services-us-west-2.html">https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/sample-templates-services-us-west-2.html</a>. Scroll down until you see Amazon Virtual Private Cloud. Once Amazon Virtual Private Cloud is clicked you’ll be guided to the following;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*wICncy8qkGUTW4DSYpjQCg.png" /></figure><p>Here we want to click on View in Designer in the Autoscaling and load-balancingtemplate. Once in the designer view you will get the generic template example. You can choose between JSON or YAML, the two are coding languages. Copy the example template and head to your editor. For me I used Visual Studio Code.</p><p>At first I picked JSON because I understand the { } scheme, but about half way I realized it would be easier to use YAML, as it’s more human-like to read.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6-zatdHxfe5F7-nsHnB4oA.png" /><figcaption>Example of YAML code</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*VBTLwEs3jrj8A9CyQsXBeg.png" /><figcaption>Example of JSON code</figcaption></figure><p>(Above is just a reference of the two languages to choose from)</p><p>Once you pick your language and copy it to your editor it’s time to make some changes. In this project we were restricted to a minimum of 2 instances and a maximum of 5.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a2CLcq27NQ5-yRkqpQpPcw.png" /></figure><p>We were also told to use t2.micro for this project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FqYPxdLkrGwr5q_GKTgT0w.png" /></figure><p>Instances should be across 2 AZs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a5wM8EIJRMq97mIJheraxQ.png" /></figure><p>Our final change was to install Apache.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*nK3y_gQ-QL2ui5QKe4UU6w.png" /></figure><p><strong>Step 2</strong>: <strong>Uploading</strong> our template. We now have copied an example template and made some modifications to it. Now we want to use our template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*wICncy8qkGUTW4DSYpjQCg.png" /></figure><p>Back on this page instead of clicking on View in Designer we want to click Launch stack. Here we will be asked to either create or upload a template. We’re going to upload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*EjlMAPkUxmITCMoYHEX-sQ.png" /></figure><p>Click next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*H1wLQN3y5RC5SPPKOJAFaA.png" /></figure><p>On this page I filled in some information. At the bottom of the page there is also a Next button, click that. You’d be prompt to a third page, which you can leave default, however, at the bottom of this page there’s a Create Stack button. Click Create Stack and your template will build itself if there’s no errors.</p><p><strong>Step 3</strong>: <strong>Wait</strong>. Wait. And wait some more. You’ll be waiting for awhile as your template is being built. Once it’s completed you’ll see the following;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*LmfDamn00w3qdlkKGFdMvw.png" /></figure><p><strong>Step 4</strong>: Make sure your instances are running properly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*dsl3Z-arrxB2M3gJOeCiIA.png" /><figcaption>(The bottom 2 are for this project)</figcaption></figure><p>We can see a Running state. So far we’re looking good.</p><p><strong>Step 5</strong>: Make sure the Auto Scaling Groups are running properly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*4Q773oVauMfkRmpFwlNptQ.png" /></figure><p>We can see that our Auto Scaling Group is working correctly. It has the correct amount of Instances, Min, and Max.</p><p><strong>Side note (can skip if wanted)</strong>: To further test the Auto Scale Group, we can terminate some instances and it should create a minimum of 2 more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*HPiJSrqxmHNjd-F_0MWfJQ.png" /><figcaption>Terminating instances</figcaption></figure><p>Once the instances are terminated wait a few minutes and you should see another set of instances created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ppll0snPC9O0lPLbM8dwNA.png" /></figure><p><strong>Step 6</strong>: Grab the IPv4 address and test it in the URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yGcxnfXSYcGqhYyEo1wLLw.png" /></figure><p>If correct you should get the following;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*vlyYW9_tiehwsS9IrgRy_A.png" /></figure><p><strong>Step 7</strong>: Terminate your Stack. If you don’t terminate your Stack you can be <strong>billed</strong> for it.</p><p>(I deleted my Stack before I could get a picture. However, in the picture below where it says Create_Complete on the left, you will see a Delete_In_Progress. From there your Stack will vanish and that means it successfully deleted)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*LmfDamn00w3qdlkKGFdMvw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48265d8349b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Apache while starting up an EC2 Instance]]></title>
            <link>https://medium.com/@shifflettko/installing-apache-while-starting-up-an-ec2-instance-808260d7a8e1?source=rss-65caae5a9499------2</link>
            <guid isPermaLink="false">https://medium.com/p/808260d7a8e1</guid>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Kashawn Shifflett]]></dc:creator>
            <pubDate>Mon, 16 May 2022 03:11:39 GMT</pubDate>
            <atom:updated>2022-05-16T03:11:39.969Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3Fhr8qrKzQGA0LXO" /><figcaption>Photo by <a href="https://unsplash.com/@larskienle?utm_source=medium&amp;utm_medium=referral">Lars Kienle</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>What is <strong>Apache</strong>? Apache is one of the top open-source web server used today. And it’s <strong><em>FREE</em></strong>.</p><p><strong>Side Note</strong>: This project will be shorter and straight to the point.</p><p><strong><em>Prerequisite:</em></strong></p><ul><li>AWS account</li><li>MFA Code (to access AWS account)</li></ul><p><strong>Goals for this project:</strong></p><ul><li>Create t2.micro EC2 Instance with OS of your choice (use free tier)</li><li>Update all packages (using User Data)</li><li>Install Apache (using User Data)</li><li>Start Apache (using User Data)</li><li><strong>Verify</strong> that Instance is running Apache correctly on IP Address</li></ul><p><strong>Step 1</strong>: We must set up an EC2 Instance. To do so while on the AWS Dashboard, look in the top left click services . Once clicked, there will be a dropdown menu. Click EC2 . Once on the EC2 Dashboard you’ll see Launch Instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sStvSB5eQKwplsickgFlww.png" /></figure><p>Click Launch Instances to get into detailing how you want your Instance setup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*mL5jobrOBwK-UvKZ3fp7Qg.png" /></figure><p>Here we set our AMI (Amazon Machine Image). A goal of this project was to use free tier as much as possible. This project wasn’t very big so free tier is perfect for our use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WYlr2iRzcc2FcfoOfa9DKA.png" /></figure><p>Above, we set Instance type to t2.micro which is also a free tier (again perfect for us).</p><p>Above, we set our key pair . A key pair is very important to all projects, any size. You can either create a key pair or pull from an existing one. Here we pull from an existing key pair created already. It’s important that a key pair is saved as a .pem, if not you wont be able to SSH into the Command Line if needed. A key pair should be saved somewhere where no one else can access other than yourself.</p><p>No project is secured without <strong>security. </strong>Continuing modifying our Instance we must add some security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*Trua6EvNrqdHyvxSE_4ldQ.png" /></figure><p>Here <strong>VPC </strong>should be left as default. Skip down to Create security group or Select existing security group. In this project I pulled from an existing security group to save time. However, if you’re wondering what it looks like to edit a Security Group, it looks like the following;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*iD9XxG7VG2JyHRkkyugkmw.png" /></figure><p>SSH port is 22 . HTTP port is 80 . Not shown but HTTPS port is 443 . If Security Group isn’t set up correctly when you go to test your Instance you may get an error message.</p><p>All the above is in one step.</p><p><strong>Step 2</strong>: Next in the Advance details section we look for User Data and here is where we want to implement/install Apache in the boot up of our Instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*btON4ha9fHNU8_Mwux9GZg.png" /></figure><p>Step 3: <strong>Verify</strong> Instance is ran correctly and is working.</p><p>If you’re happy with everything you modified click Create Instances. You will get a success message if all required info is completed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*D_o24ocombW0804v8s4ubA.png" /></figure><p>Click View all instances. You will be back to the Instance Dashboard. Click on your Instance and you’ll see the following;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ts3LkjXtkEiE4P_nCXvv9w.png" /></figure><p>Copy the instance’s Public IPv4 address. Head over to the URL and copy your Public IPv4 address into it. If Instance is setup correctly you should see the following.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZoG7gGiw_rueMuPhxZtI7A.png" /></figure><p>This is how you setup Apache while booting up an Instance! This project focuses mainly on setting up your Instance how you want. That part may take some time if you’re new to it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=808260d7a8e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating an Auto-Scaling Group and EC2 Instances in AWS]]></title>
            <link>https://medium.com/@shifflettko/creating-an-auto-scaling-group-and-ec2-instances-in-aws-c66dac11e73a?source=rss-65caae5a9499------2</link>
            <guid isPermaLink="false">https://medium.com/p/c66dac11e73a</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ec2-instance]]></category>
            <category><![CDATA[linkedin]]></category>
            <dc:creator><![CDATA[Kashawn Shifflett]]></dc:creator>
            <pubDate>Mon, 09 May 2022 06:00:47 GMT</pubDate>
            <atom:updated>2022-05-09T23:09:43.568Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LJ1VyyilE63sA1Nw" /><figcaption>Photo by <a href="https://unsplash.com/@sunriseking?utm_source=medium&amp;utm_medium=referral">Sunrise King</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>First question is “What is EC2 Instances?” EC2 Instances is a virtual server in Amazon’s Elastic Compute Cloud. EC2 Instances can help everyday people to produce/deploy applications across the world at a blink of an eye.</p><p>Second question is “What is Auto-Scaling?” Auto-Scaling contains a group of EC2 Instances that are known/created as a group to help management.</p><p>Now that we know what EC2 Instances and Auto-Scaling are we can put the two together and easily create sites that can be distributed all across the world.</p><p><strong><em>Prerequisite:</em></strong></p><ul><li>AWS account</li><li>MFA code</li></ul><p><strong>Goals for this project:</strong></p><ul><li><strong>Create</strong> a <strong>template</strong> with a <em>minimum</em> of 2 and a <em>maximum</em> of 5 <strong>instances</strong></li><li><strong>Auto-Scale</strong> group with at <em>least</em> 3 <strong>subnets</strong></li><li><strong>Terminate</strong> at <em>least</em> 1 <strong>instance</strong></li></ul><p><strong>Step 1</strong>: Create an EC2 launch template. On the AWS homepage we navigate to the top left click Services. Then click Compute. Inside Compute you should see EC2, click that. Once on the EC2 Dashboard look to the left side of the screen and find Launch Templates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*ZdEFBYcdYVEXTlPVdKgTvw.png" /></figure><p>Click the orange button the says Create launch template .</p><p>Now you should see a page that looks like the following;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*ShrjEGzR423RcW7NM9jWzg.png" /></figure><p>Here we enter what we would like to call this template. I called it shawn-project-week5 . You can add the description of the project if you’d like, I just used the the name.</p><p>Next I picked what AMI (Amazon Machine Image) I wanted to use. As well as what Instance type I wanted to use. Below, I decided to go with the Free tier eligible option. For this project Free tier eligible is perfect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*JnvBBpfRG4W10Z1e6-wWAQ.png" /></figure><p>Next you want to either create or pull an existing key pair . key pair is very important part of this (and many other) projects. With a key pair you want to store it somewhere safe and somewhere you’ll be able find for a later use. If you don’t save the key pair you most likely wont be able to ssh into the Command Line (CLI) later. I’ve learned the hard way and after a few times you learn how important key pair are to a project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*Yspq2OEQUqMfZJK05MrJUw.png" /></figure><p>With key pair I left the Key pair type to default, RSA . However, you may need to change the Private key file format from .ppk to .pem . For this project I used a CLI not PuTTY so I saved my key pair using the .pem format.</p><p>Next you may have to modify the security section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*fWqAYAyboMq8Oya-EHsuhA.png" /></figure><p>I left everything default here. But if you need to make changes you can click on Create security group and it will give you different options to pick from to your liking.</p><p>Next I skipped all the way down to User data. Here is where I wrote my very simple HTML code to print to another IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*AE091pK7-oI8SE2qdw0DRQ.png" /></figure><p>(The above is all one step). Now that we’ve entered what we want our template to have there’s a Crete template button on the bottom right, click that and your template is made.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K-atgD__xK9xlTk20HSRLQ.png" /></figure><p>If you’ve entered all the required steps you should get a Success message.</p><p><strong>Step 2</strong>: Create an Auto-Scaling Groups. Back on the EC2 Dashboard if you navigate to the left and scroll down until you see Auto-Scaling click that and you’ll get a dropdown menu. In the dropdown menu click Auto-Scaling Groups and you’ll be prompt to create it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*jmauTCAyoqUjZ7k9_WpSGQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*AGssrGrDepB0WUca08dFmg.png" /></figure><p>Once you click the Create button you’ll get what’s above. Again, you will have to go through and enter what you would like for this template to have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*XIYRQNOpCBy1sZ4KMPURDA.png" /></figure><p>In the Networking section I left the VPC default and added 4 Subnets. This will store our template in different Availability Zones (AZ). Having your templates in more than 1 AZ is highly recommended. You never want to put your faith in 1 AZ. If a natural disaster occurs where your AZ is you have the opportunity to lose your data. Its highly recommended to have a back up AZ for events like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*vnRuUsRg6XcEO6UzmZsVbQ.png" /></figure><p>I left the Load balancer default.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/1*jnRDe7ysgDuTNyn8fke-1w.png" /></figure><p>Above is where we will determine how many instances are created. For this project we were restricted to 2 minimum and 5 maximum. Desired capacity is placed at 4, this will create 4 instances that the template is stored in.</p><p>Now that the required info is in we can click Create Auto Scaling group .</p><p>Once again if everything is in that’s needed you should get a Success message that looks like;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*j1e4nAhd6PwRNHVMMwaHAQ.png" /></figure><p>Back in Instance you should see the following;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*wcTWEWjeUwpBfAhkpcGiFw.png" /></figure><p>We know everything is working how it should if you can see the correct desired capacity amount and 2/2 checks passed.</p><p><strong>Step 3</strong>: Testing to see if instances are running properly. Back in instance if you click on one of the Instance ID it’ll display basic info about that instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*MUsThns1bj5p0Zc3seO9gQ.png" /></figure><p>Inside copy the Public IP4 Address and head to a webserver to test it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9TMSH2A00yF3lZBRcgRS8g.png" /></figure><p>Here we can see the Public IP4 Address in the URL. The output “Welcome to my tester” which was what I entered for my User data so we know the instance is running as it should.</p><p><strong>Step 4</strong>: Terminate an instance. Back in instance, you can see little squares next to the Instance ID . Click the square and navigate for the Instance State dropdown menu. Inside the dropdown menu will be Terminate Instance . Once you click Terminate Instance you’d be asked to confirm you’d like to terminate it. If you do, it will take a few seconds to terminate the instance so don’t be surprised if you don’t see any action right away.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3sAYIKVn_FtAOLjFoehTtw.png" /></figure><p>Your screen will go from the above to the below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*Y9CBHkklbLIv-djIW5LMyg.png" /></figure><p>That is is how you create/terminate an EC2 Instance and Auto-Scaling Groups. This is a <strong>very</strong> small example, but now we know the basics and can one day create fleets of instances in the hundreds.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c66dac11e73a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>