<?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 Asonti Ginn on Medium]]></title>
        <description><![CDATA[Stories by Asonti Ginn on Medium]]></description>
        <link>https://medium.com/@asontidg?source=rss-f55ba76d5975------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GWbl58X3zHZ0UBCGgXBInQ@2x.jpeg</url>
            <title>Stories by Asonti Ginn on Medium</title>
            <link>https://medium.com/@asontidg?source=rss-f55ba76d5975------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 16:28:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@asontidg/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[~Creating a Highly available Webapp with CloudFormation and Code Pipeline~]]></title>
            <link>https://blog.devops.dev/creating-a-highly-available-webapp-with-cloudformation-and-code-pipeline-a0b915d374fd?source=rss-f55ba76d5975------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0b915d374fd</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <dc:creator><![CDATA[Asonti Ginn]]></dc:creator>
            <pubDate>Wed, 29 Nov 2023 03:45:47 GMT</pubDate>
            <atom:updated>2023-12-01T08:33:03.861Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nMQkxHzsfFYeHe-7l2GnVw.gif" /></figure><h3>Today’s Goals</h3><p>~ Create a CloudFormation Template that will deploy a web application.</p><p>~ Create an Auto Scaling group that will and scale out when your instance reaches the threshold set on alarm.</p><p>~ Create a CloudWatch alarm for when the CPU is too high and the Auto scaling is going to occur</p><p>~ Move this to Code Pipeline so if we update the CloudFormation Template it will automatically deploy any updates.</p><h3>Key Terms</h3><p>~ CloudFormation: An Infrastructure as code tool that allows you to deploy AWS resources.</p><p>~ EC2: A virtual machine that allows you to host applications inside.</p><p>~ CloudWatch: A monitoring service that allows you to view metrics and set alarms for services within AWS.</p><p>~ Auto Scaling Group: An AWS service that will scale your application up or down when a specific requirement is met.</p><p>~ Code Pipeline: A CI/CD tool inside AWS that helps with automatic deployments of updates.</p><p>~Highly Available: Spreading an application across multiple availability zones to help with horizontal scaling.</p><h3>Project Benefits</h3><p>~ With CloudFormation being an Infrastructure as Code tool, it allows the template to be reused and reproduced in another cloud application. This also helps with cost savings.</p><p>~ Using CloudWatch and Auto Scaling allows performance monitoring, this helps with finding certain issues with the application. As well as if the CPU is exceeded the auto scaling can help create high availability.</p><p>~ The pipeline helps with smooth deployments, reducing the time it takes to update applications.</p><h3>Prerequisites</h3><p>~ AWS Knowledge.</p><p>~ (Optional) Have a custom Webpage created and input inside a GitHub Repository. You can use my Cloud.html file that is located inside my repo below.</p><p>Here is my Repository on GitHub that contains all the code I used during this project.</p><p><a href="https://github.com/Asonti04/formation.git">GitHub - Asonti04/formation</a></p><h3>CloudFormation Template</h3><p>Begin by uploading your website html file inside a new repository on GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*FEb6WdXgDZdBZ65upnlnMA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*osfD6nOcDtNM5JxMGCrJhg.png" /></figure><p>After you have committed your code to your repo, we need to copy the downloadable Zip file link.</p><p>To copy the link simply right click the Download zip and select copy link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*NUredyrD869VHW2CraQN3g.png" /></figure><p>Next enter your code editor, we will be creating the template. Our CloudFormation template will launch an EC2 instance that has Apache installed, and your webpage will be the custom Apache webpage.</p><p>Set the top of you template as the resource, underneath set the name of the resource you are creating, and the type is an EC2 instance.</p><pre>Resources:<br>  MyInstance:<br>    Type: AWS::EC2::Instance</pre><p>The different properties you need:</p><p>~ AMI ID in your region</p><p>~ Instance type/size you are using</p><p>~ Key-pair</p><p>~ User data will install Apache and add your webpage</p><pre>Properties:<br>      ImageId: <br>      InstanceType:<br>      KeyName: <br>      UserData:<br>        Fn::Base64:<br>          !Sub |</pre><p>We do not need to define a VPC or Security Group for this project it will automatically use our defaults. Just make sure your default allows ssh and http inbound traffic. If you do need to define these resources, you can use this documentation to help you.</p><p><a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-formats.html">AWS CloudFormation template formats — AWS CloudFormation (amazon.com)</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EJAYxTvUG8GlsZNnjbVqHQ.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9dfe1b3ac2e615297631a667a7a0a7b6/href">https://medium.com/media/9dfe1b3ac2e615297631a667a7a0a7b6/href</a></iframe><p>Save this CloudFormation Template to your Desktop you will need this to create your stack.</p><h3>Stacking</h3><p>In your AWS Console go to CloudFormation and create a stack with new resources. For the Template select the Template is ready because we just created our template above. Then Upload the file from your desktop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*68kg5yHpCdk4-ZPKFlUZDA.png" /></figure><p>Next, add a stack name, keep the remaining settings default and deploy your stack. Once the stack says it has been created successfully you can go to your running Ec2 instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qTNHkeYivLzH_FzE55Hw1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4jkjUvIp-RCsG0UD5lcI_Q.png" /></figure><p>Wait until your instance is running and it has passed both health checks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vt1NUGtrUlPQRrGoPmAYRA.png" /></figure><p>Once it is healthy copy your IP Address into the browser followed by the port :80 and you should see your webpage up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4z9w6yJEMaUUc-iLnj_XXQ.png" /></figure><h3>AUTO SCALING</h3><p>Now we need to create an auto scaling group. You will need a launch template for your auto scaling group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*YmrOnecRaBWg6lWvQYdsbw.png" /></figure><p>In another tab open your EC2 Console, click the instance we created earlier and select Actions &gt;&gt; Images &gt;&gt; Create template from instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R5M0WXW7mR2W-4GKYCeuyg.png" /></figure><p>Simply give the template a name and a description, and you can create it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yS8ho9Yymcu274F_d37U4A.png" /></figure><p>Now add your launch Template to your Auto Scaling group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*B8ld57gj5BRj5T7Jrko_Cg.png" /></figure><p>In the Network use your same default VPC from you template and use all of your AZ’s available, this will help make it highly available when the ASG scales out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*_qAIEhAimzQc5OnCq9ApWA.png" /></figure><p>Set the maximum number of instances to 3 and the minimum to 1. Keep the target tracking policy on and set the target value 1. We are setting it to 1 so we can see the scaling actually happen, this value would not be ideal in a production environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*CM_L7XkXouWay8yeReiuBw.png" /></figure><p>On the last page add a notification so you can be alerted when the autoscaling occurs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*IkZVXE4J-bqnZIDKPrIMyQ.png" /></figure><h3>CLOUDWATCH</h3><p>Now head over to Cloud Watch go to All metrics then select EC2 since we will be monitoring EC2 instance CPU Utilization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iYpBdMDPgnzXnsaivpWYbg.png" /></figure><p>Under metrics pick by ASG since these are the EC2 instances we want to be alerted about. Make sure you select the correct ASG name for the metric. We will be tracking CPUUtilization and create your alarm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*YqoBWMdjxNK_rVm5b1gOXQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rG-R7dOqkEWmh69l0yQOKA.png" /></figure><p>Set the time period as low as 1 minute, that is the lowest we can go without adding on extra charges. Set the threshold as low as 1 so we can see the alarm working in action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*gLeBUXUPqejtTi4Y9wx25Q.png" /></figure><p>Use the SNS topic we created above for when the EC2 instances are in alarm. Then set a name for the alarm and create it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*ZCmMHS0_E0xHBHUZcqSCIw.png" /></figure><p>Since we set the CPU value to only 1, once you have finished making the Auto Scaling Group you can reload the webpage. You will see CloudWatch says the CPU is exceeded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*izJiEq_e68ffAY1sQINwFw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y1nTZR_BdmW2HlUf_cbiwg.png" /></figure><p>Now you can go back to your Auto scaling group and in you Activity History you will see that it has already began scaling because of the CPU usage being too high.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kfm0PEUbdl4KyC_CvIjYkQ.png" /></figure><p>In EC2 you should now have 3 additional EC2 Instances. This shows that the Auto scaling group and alarms are working together to provide the proper number of resources. You can also see that the new EC2 instances are in different availability zones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tZzgguKDyLTrU8UD-2zauw.png" /></figure><h3>CI/CD TIME</h3><p>Create a new GitHub repo that only contains the CloudFormation stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KhQ9YTmDLVJwqRrIAltGSQ.png" /></figure><p>Now go to Code Pipeline and create a pipeline. Name your pipeline, and if you have an existing service role you can use that. If not make a new service role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YhGDWgd6krYQPM8CTUvENg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*OcqsMDSMuIlHSBL5GNM_Kg.png" /></figure><p>For your Source we will use GitHub Version 2. If you have a previously used connection, please use that one. If not, you can connect your GitHub and it will create a connection for you.</p><p>Be sure to click on the new repository that has your CloudFormation template and enter the branch name attached to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*hFzD7941E-px-4rP3Z6V8A.png" /></figure><p>You can skip the build stage it is not needed for this project.</p><p>We will be using CloudFormation for the Deployment stage. For that Action set it as an update. We will be testing this pipeline by updating the stack later. Add the correct stack name to check for updates.</p><p>The Template needs to have the Artifact name as the SourceArtifact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*IQYb2NsQ2J_tVeMvuyHjGA.png" /></figure><p>Next it is going to ask you for a service role name, we have not created one. You will need to create a service role, open IAM in another tab and select create role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dlJpg4txz4_BSi1MJ3Y89A.png" /></figure><p>The role will be an AWS Service and the use case is CloudFormation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xyFCLn5jLgdE0LknKNmQPw.png" /></figure><p>Next, we need to add CloudFormation Full Access and EC2 Full Access permissions. Name your role, add a description, and create it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P031eIfOi0bB3Cq-GbAePA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VBRSgQ0PRhX5OnbdYPHEGw.png" /></figure><p>Return back to your pipeline and add your service role and select Next. Then you can review your pipeline to fix any mistakes made and deploy it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*nn74n5IH16r_Fd5xvpF2xg.png" /></figure><p>Once the pipeline is deployed you should see it has been successfully deployed by displaying the green check marks on the side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PknwNaCcRPAB8scWGgxVRw.png" /></figure><h3>TEST IT OUT</h3><p>Now we need to test to make sure that the CI/CD automatic deployments are working. In GitHub add this block of code to your CloudFormation Template. This will create a S3 bucket in your account.</p><pre>MyS3Bucket:<br>    Type: AWS::S3::Bucket<br>    Properties: {}         </pre><p>Once you commit your changes, your pipeline should begin to update.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0uR_7UZCAM58NCskQXKgbQ.png" /></figure><p>In your Stack you should see that a bucket was added to the stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7146Xm8t8T9_3h5MF5p2qA.png" /></figure><p>Head over to S3 and verify the bucket is available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qlRdm5MosJxy5KsuEfIjsA.png" /></figure><p>Thank you for reading my article. This project helped you learn how to: Automate, Auto Scale, and Monitor metrics.</p><p>For more, easy to follow articles, follow me on Medium!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0b915d374fd" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/creating-a-highly-available-webapp-with-cloudformation-and-code-pipeline-a0b915d374fd">~Creating a Highly available Webapp with CloudFormation and Code Pipeline~</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[~Creating a HTML Report with a Jenkins Pipeline~]]></title>
            <link>https://medium.com/@asontidg/creating-a-html-report-with-a-jenkins-pipeline-df434ae42372?source=rss-f55ba76d5975------2</link>
            <guid isPermaLink="false">https://medium.com/p/df434ae42372</guid>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Asonti Ginn]]></dc:creator>
            <pubDate>Sun, 15 Oct 2023 23:56:54 GMT</pubDate>
            <atom:updated>2023-10-15T23:56:54.337Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hU9voJHtrcqc1OFkIEDVcA.png" /></figure><h3>Today’s Goals:</h3><p>~ Install Jenkins inside a Docker Container and unlock it.</p><p>~ Create a pipeline that uses a GitHub repository.</p><p>~ Verify that your HTML Report loads.</p><h3>Key Terms:</h3><p>~ HTML: This is a coding language used for Website/Webpage creation.</p><p>~ Jenkins: Jenkins is an open source web server that can be used for automation. This is considered a continuous integration tool.</p><p>~ Docker: With docker you can build, update, and run containers.</p><p>~ Container: A container is made from an image, and it packages up code so it can run quickly in other environments.</p><p>~ GitHub: A website used to share and store your code with the world</p><p>~ Repository: Holds files used to track progress throughout a project.</p><p>~ Pipeline: Allows automation for your applications.</p><h3><strong>Prerequisites:</strong></h3><p>~ Basic knowledge about how a CI/CD pipeline works.</p><p>~ Have a github repo containing your HTML code.</p><h3><strong>Installing Jenkins</strong></h3><p>I will be hosting my Jenkins inside a Docker container, if you already know how to install and configure Jenkins you can skip past this part.</p><p>Start by pulling the Jenkins docker image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ULDmdiNxdSEQ-kPq.png" /></figure><pre>sudo docker pull jenkins/jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*Op3b8Azzrt9iq7c3_Id2_g.png" /></figure><p>Next you need to create the container with its own volume for persistent storage. Jenkins uses 2 port numbers, 8080, and 50000.</p><pre>sudo docker container run -d -it -p 8080:8080 -p 50000:50000 -v jenkins:/var/jenkins_home jenkins/jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f68xi-Zqy4_NROtmCADTzA.png" /></figure><p>Now we need to retrieve the admin password so we can sign into our Jenkins. This code below will call out the password from its location in the initialAdminPassword file. Be sure to copy your password.</p><pre>sudo docker exec &lt;CONTAINERID&gt; cat /var/jenkins_home/secrets/initialAdminPassword</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Zdgs5wc42Z_dlcX9iQ9-g.png" /></figure><p>In your browser input your IP Address followed by the port 8080. The Unlock Jenkins landing page should appear. Input your password and sign in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a1dk6CEy9I7tL8H-SQC_SA.png" /></figure><p>You can simply install suggested plugins and then create your admin user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*5feam2LfCzXg06g-nRb6Vg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*SnVEMIbySIERKwBZwowg0g.png" /></figure><h3>Setup for the Pipeline</h3><p>Once your Jenkins web page load select “Manage Jenkins” and select “Plugins”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O3giTVkNF4nSXVYyrrXomg.png" /></figure><p>Under available plugins type html and install the HTML Publisher, we need this to create our HTML reports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rFDebtt0cGNiIZVMmR3vPA.png" /></figure><p>Return back to the home page in the left corner select New Item so we can begin pipeline creation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K4dYA2VymE6Lr6AOT1p6ng.png" /></figure><p>Name your pipeline, mine is html-pipeline-1 and select pipeline. You could also use HTML with a freestyle project, but today we are doing a pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VU_t4jTF9bxYLOmSqJYh0g.png" /></figure><p>In the General section make the pipeline a GitHub project and paste the URL of your entire GitHub repo that has your code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YSvsiWlDyLsp9WjBJMQeeA.png" /></figure><p>The build trigger will be the GitHub hook trigger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5nU1OdEZLwQtEO4dqPa68g.png" /></figure><h3>Pipeline Config</h3><p>Next is the pipeline configuration, first we are making our definition a Pipeline script and change it to Hello World. Select Pipeline Syntax and open it in another browser. This will provide us with a snippet to use for our pipeline to work properly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TpFrx-qyDzS1NTnFl8f6UA.png" /></figure><p>Set the Sample Step to publishHTML. The Index page needs to be the name of the HTML file you are using inside of your repository, mine is jen.html. Then click Generate and copy the code it provides to you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QBQKOiwRp7sReNee3KemnA.png" /></figure><p>Back at your pipeline script change the stage to, Deploy html site, and paste your copied code over line 7.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lbxAPROhEYcqvcMVefDXKg.png" /></figure><pre>pipeline {<br>    agent any<br><br>    stages {<br>        stage(&#39;Deploy html site&#39;) {<br>            steps {<br>                publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: &#39;&#39;, reportFiles: &#39;jen.html&#39;, reportName: &#39;HTML Report&#39;, reportTitles: &#39;&#39;, useWrapperFileDirectly: true])            }        }<br>    }<br>}</pre><p>Copy all of the script and head over to your GitHub repository. Create a new file inside the repository and paste your code. Name the file Jenkinsfile and commit your changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*yvYOh-RQoSIKxW9Koi9vhQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*SXsZENKrPO1ak7b6rBPGrg.png" /></figure><p>Now copy the HTTPS link to your repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*acWAHW5OXHlAfQouOHTW-w.png" /></figure><p>Back in your pipeline change the definition to script from SCM and use Git.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YzVtfXBMTKOVMZzfH4UZ0w.png" /></figure><p>The repository URL is the URL we just copied and make the branch the name of the branch you are using, I am on main.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F1WEKBWJuegnMu6lwUMLtg.png" /></figure><p>Set the Script Path to the Jenkins file we added to your GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aVCuMLhq1uEUhaYfxtqeNQ.png" /></figure><p>Now save your Pipeline it should start a build automatically but if not you can always select Build Now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*mSiJ1vpeiDAZ02VopkU3Zg.png" /></figure><p>After 4 tries, I finally got my pipeline to work, yours will work on the first try if you follow along properly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*8OTCJjtyq7LhKtKv4s_idA.png" /></figure><h3>TEST IT OUT</h3><p>When the Pipeline is finally successful, you need to run your HTML Report so your page can come to life.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*hEdf509s79qsC9EcMNowZg.png" /></figure><p>WOW, my page is up but it doesn’t look quite right. The background is supposed to have color and I have a picture on my website as well.</p><p>It seems some permissions need to be allowed on our pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*Jz0W3mshzt41ujewbdh2TA.png" /></figure><p>In your Jenkins Dashboard, go to manage Jenkins and select your nodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zhk0Fosb2dyvay3ijgyB-Q.png" /></figure><p>Select the Node we just created and select the Script Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LB26f87cQTq9apDrZTLt5g.png" /></figure><p>Inside the script console input this text. This allows us to see the Internal CSS on our HTML Report. Jenkins automatically blocks this for us.</p><p>After you add this text select run and results should appear at the bottom.</p><pre>System.setProperty(&quot;hudson.model.DirectoryBrowserSupport.CSP&quot;, &quot;&quot;)<br>System.setProperty(&quot;hudson.model.DirectoryBrowserSupport.CSP&quot;, &quot;sandbox allow-same-origin allow-scripts; default-src &#39;self&#39;; script-src * &#39;unsafe-eval&#39;; img-src *; style-src * &#39;unsafe-inline&#39;; font-src *&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t0ep8YNDXzeD7wnlBd0yHQ.png" /></figure><p>You can return back to your pipeline and refresh the report, the design is now appearing on the report as it would on a regular webpage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n287gP5RrT3zwrtet-sj2w.png" /></figure><p>We have successfully made an HTML Report with a Jenkins Pipeline.</p><p>Here is a link to my repository, containing the code for this project.</p><p><a href="https://github.com/Asonti04/jenkins-project.git">GitHub - Asonti04/jenkins-project</a></p><p>For more, easy to follow articles, follow me on Medium!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df434ae42372" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[~Launching Instances using an Auto Scaling Group with Terraform~]]></title>
            <link>https://medium.com/womenintechnology/launching-instances-using-an-auto-scaling-group-with-terraform-7e710e47435a?source=rss-f55ba76d5975------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e710e47435a</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <dc:creator><![CDATA[Asonti Ginn]]></dc:creator>
            <pubDate>Tue, 08 Aug 2023 04:16:18 GMT</pubDate>
            <atom:updated>2023-08-20T03:51:07.780Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*DQFIMHufiDl0YJ5-J5uQYQ@2x.jpeg" /></figure><h3>Today&#39;s Goals:</h3><p>~ Create a S3 Bucket and set the bucket as the backend.</p><p>~ Create a new security group and attach it to the auto scaling group and launch template.</p><p>~ Have the Auto Scaling group span 2 subnets, have a max of 5 instances, and minimum of 2 instances.</p><h3>Key Terms:</h3><p>~ Terraform: Hashicorp Language that uses Infrastructure as Code and works with different providers to create resources, such as AWS.</p><p>~EC2 Instance: Stands for Elastic Compute Cloud which is a virtual server inside the AWS Cloud.</p><p>~ Sudo: Allows you to run commands as if you are the root user in a terminal.</p><p>~Auto Scaling Group: Helps you manage and scale the number of instances you need by implying the maximum and minimum amount of instances you want.</p><p>~Launch Template: Used to make instances with the same settings, similar to making your own personal default settings for your instances.</p><p>~Apache: A free Open-source web server, it can run on a wide range of Operating Systems, is highly customizable, and contains strong security features.</p><h3><strong>Prerequisites:</strong></h3><p>~ Have an AWS Account with a Cloud9 environment set up.</p><p>~ Terraform installed on your IDE if you are not using the Cloud9 environment.</p><h3>S3 Bucket</h3><p>In AWS we need to create an S3 bucket, the name must be globally uniqiue or it will not work. We will be using this bucket to store our terraform state files instead of inside your Cloud9 environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*lbv2uDkt-2gdT9qpKrVSvg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*WQm3zQvHhgSw5oiSB5WpTw.png" /></figure><p>To keep up with the different versions of your terraform state file, I will suggest you turn on Bucket Versioning, this is an optional feature. Then you can create your bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*N689YyyDguugiUjPx16mag.png" /></figure><h3>File Creation</h3><p>In your Cloud9 environment create a new directory for this project then change to that location.</p><pre>mkdir week21project<br>cd weekw21project</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bHFsT1sDdp7WJopqIGAiRg.png" /></figure><p>Then make new files for this project, we need 4 files.</p><pre>touch variables.tf main.tf terraform.tf script.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eg82GenatkBwa5Hb50hGCA.png" /></figure><h3>terraform.tf</h3><p>We are going to edit the terraform.tf file first. This file will hold our provider and our backend configuration. The provider is AWS and the backend will be the bucket we created above.</p><p>The key attribute for the bucket will be the name of the state file.</p><pre>terraform {<br>  required_version = &quot;&gt;= 1.0.0&quot;<br>  required_providers {<br>    aws = {<br>      source = &quot;hashicorp/aws&quot;<br>    }<br>  }<br>  backend &quot;s3&quot; {<br>    bucket = &quot;BUCKET-NAME&quot;<br>    key    = &quot;state&quot;<br>    region = &quot;us-east-1&quot;<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*xE4x3yguhQsmy0Mk8c6mHQ.png" /></figure><h3>Variables.tf</h3><p>For the variables file we will define multiple variables that we will use inside our main.tf file. This is used to avoid hard coding information into the file. Each variable uses a default and a type to define the variable.</p><pre>#Default VPC <br>variable &quot;vpc_id&quot; {<br>  type    = string<br>  default = &quot;vpc-&quot;<br>}<br>#Two subnets in the defualt VPC<br>variable &quot;subnets&quot; {<br>  type    = list(string)<br>  default = [&quot;subnet-&quot;, &quot;subnet-&quot;]<br>}<br>#amazon linux ami<br>variable &quot;ami&quot; {<br>  type    = string<br>  default = &quot;ami-09538990a0c4fe9be&quot;<br>}<br>#ASG name<br>variable &quot;name&quot; {<br>  type    = string<br>  default = &quot;week21project&quot;<br>}<br>#instance type<br>variable &quot;type&quot; {<br>  type    = string<br>  default = &quot;t2.micro&quot;<br>}<br>#Port numbers<br>variable &quot;ingressrule&quot; {<br>  type    = list(number)<br>  default = [80, 443, 22]<br>}<br>#all traffic CIDR Block<br>variable &quot;block&quot; {<br>  default = [&quot;0.0.0.0/0&quot;]<br>}<br>#to/from port <br>variable &quot;ports&quot; {<br>  type = number<br>  default = 0<br>}<br>#true value<br>variable &quot;enable&quot; {<br>    default = true<br>}<br>#traffic protocol for egress rule<br>variable &quot;protocol&quot; {<br>  type = string<br>  default = &quot;-1&quot;<br>}<br>#protocol for the dynamic block<br>variable &quot;dynamic_protocol&quot; {<br>  type = string<br>  default = &quot;TCP&quot;<br>}<br>#your default VPC CIDR block<br>variable &quot;vpc_cidr&quot; {<br>  default = [&quot;172.0.0.0/32&quot;]<br>}<br>#max instances number<br>variable &quot;max&quot; {<br>  type = number<br>  default = 5<br>}<br>#min instance number<br>variable &quot;min&quot; {<br>  type = number<br>  default = 2<br>}<br>#your key pair<br>variable &quot;key&quot; {<br>  type = string <br>  default = &quot;key-pair&quot;<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*zdtE69HAQPkAAO1uAGdURA.png" /></figure><h3>Script.sh</h3><p>This script will update the server and install Apache with a custom Webpage. We will attach this file to our user data field in our main.tf file. I provided inline comments to inform you of what each line of code does.</p><pre>#!/bin/bash<br>#This updates the server<br>yum update -y<br>#This installs apache<br>yum install -y httpd<br>systemctl start httpd<br>systemctl enable httpd<br>#This adds your custom webpage<br>sudo echo &quot;&lt;html&gt;&lt;h1&gt;This is my Week 21 project&lt;/h1&gt;&lt;/html&gt;&quot; &gt; /var/www/html/index.html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*mPl-9dcZjJ1Hldf2NMQeQg.png" /></figure><h3>Main.tf</h3><p>We are working on our final file. The security group resource we will make first we need to add rules to allow internet access from ports http, ssh, and https. Our auto scaling group will have a maximum of 5 instances and a minimum of 2 instances. A launch template will also be made containing information about the instance and user data to be sure your instances have the same information. This makes for easier deployment.</p><pre>#create a security group using variables<br>resource &quot;aws_security_group&quot; &quot;internet-access&quot; {<br>  name   = &quot;ALL Traffic&quot;<br>  vpc_id = var.vpc_id<br>  dynamic &quot;ingress&quot; {<br>    iterator = port<br>    for_each = var.ingressrule<br>    content {<br>      to_port     = port.value<br>      from_port   = port.value<br>      protocol    = var.dynamic_protocol<br>      cidr_blocks = var.block<br>    }<br>  }<br>  ingress {<br>    from_port   = var.ports<br>    to_port     = var.ports<br>    protocol    = var.protocol<br>    cidr_blocks = var.vpc_cidr<br>  }<br>  egress {<br>    from_port   = var.ports<br>    to_port     = var.ports<br>    protocol    = var.protocol<br>    cidr_blocks = var.block<br>  }<br>}<br><br>#module that will create a launch template and auto scaling group<br>module &quot;asg&quot; {<br>  source              = &quot;terraform-aws-modules/autoscaling/aws&quot;<br>  version             = &quot;4.9.0&quot;<br>  name                = var.name<br>  vpc_zone_identifier = var.subnets<br>  security_groups     = [&quot;&quot;]<br>  min_size            = var.min<br>  max_size            = var.max<br>  desired_capacity    = var.min<br>  key_name            = var.key<br>  use_lt              = var.enable<br>  create_lt           = var.enable<br>  image_id            = var.ami<br>  instance_type       = var.type<br>  user_data           = file(&quot;script.sh&quot;)<br>  tags_as_map = {<br>    Name = var.name<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*slLl7gC_XIviyQcrkTv1yQ.png" /></figure><p>Now that we have everything added to our files lets format the files. This will make the files more readable and help with any code mistakes. If any files are edited the file name will be output.</p><pre>terraform fmt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*8bbGSpEkCAH9Ss1aG-u95Q.png" /></figure><h3>The Process</h3><p>Next, we will start the resource creation process. Begin by running the init, this initializes the file so terraform will read the providers needed and see that we will be using S3 as a backend and not the local backend.</p><pre>terraform init</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*hTK5AxFiQ4q7iwX2-eJzdg.png" /></figure><p>Once it finishes the initialization, we need to plan but before we can do that we need to go inside a file and comment a line. This line causes an error if not commented and will not allow your configuration to work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*9DpH7Q-iDGynzAYr36VMjA.png" /></figure><p>Run the following commands:</p><p>~ cd .terraform/modules/asg</p><p>~ vim main.tf</p><p>Once you are in the file type “448” this will take you to the tag line you simply need to turn this into a comment. Hit ‘i’ so you can insert the # in front. Then click “esc” and type “:wq” to save the work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*90t615Uq3w6a7G0MdEb1aA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*Y7HlRAWH2B3g7PpRbNio3Q.png" /></figure><p>After exiting the file return back to your directory.</p><pre>cd ../../..</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*ApH7aIVlxZOJQZypP8uTVQ.png" /></figure><p>Now remember we do not have the security group above, so we need to make that first. We will plan only for the security group.</p><pre>terraform plan -target=aws_security_group.internet-access</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*glQFlQGR2EJsTg3XACtxSQ.png" /></figure><p>Apply this plan only to the security group. When the security group is made it will provide the security group ID and you can put that inside your main.tf file.</p><pre>terraform apply -target=aws_security_group.internet-access</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*vOfG5x-uQQjqMZqd-e01og.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*9YESwPFBTlKn_mmUXPaUxA.png" /></figure><p>After adding the security group to the auto scaling group, you can now create the rest of the remaining resources. Run another terraform apply and this time we should see that 2 resources will be created because we already made the security group. After you have read over what will be made you can type yes to apply the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*kXgUkBzuNJqOeBjjRC-l7g.png" /></figure><h3>Is it Correct?</h3><p>When it says the Apply is complete check in EC2 to see if you have 2 instances running. Terminate one of the instances and see if another instance is created this will ensure that your auto scaling group works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*aweK4SdEz2LuAsuLnJQ7PA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vreP36Nvm7S_x8_aiRaJfg.png" /></figure><p>Then try to connect to an instance via your browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ivflYbKAgzwH8pYnVExhxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*8O97daZ3SWHBCB0cHb1WUQ.png" /></figure><p>You have successfully used terraform to make an Auto Scaling Group.</p><p>For more, easy to follow articles, follow me on Medium!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e710e47435a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/womenintechnology/launching-instances-using-an-auto-scaling-group-with-terraform-7e710e47435a">~Launching Instances using an Auto Scaling Group with Terraform~</a> was originally published in <a href="https://medium.com/womenintechnology">Women in Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[~Jenkins installation inside an EC2 instance using Terraform~]]></title>
            <link>https://blog.devgenius.io/jenkins-installation-inside-an-ec2-instance-using-terraform-91f33b5e8fe6?source=rss-f55ba76d5975------2</link>
            <guid isPermaLink="false">https://medium.com/p/91f33b5e8fe6</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Asonti Ginn]]></dc:creator>
            <pubDate>Thu, 27 Jul 2023 17:57:38 GMT</pubDate>
            <atom:updated>2023-07-28T12:27:45.732Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HwlAYLbGwtNnwGBPAoDdqQ.png" /></figure><h3>Today&#39;s Goals:</h3><p>~ Use Terraform to create an ec2 instance with a new security group and Jenkins installed.</p><p>~~ Using different files to avoid a monolith.</p><p>~ Create a S3 Bucket to hold the Jenkins Artifacts.</p><p>~ Verify you can reach your Jenkins webpage.</p><h3>Key Terms:</h3><p>~ Cloud9: An AWS IDE.</p><p>~ Jenkins: Jenkins is an open source web server that can be used for automation. This is considered a continuous integration tool.</p><p>~ Ubuntu: Ubuntu is a free Open-Source Linux distribution.</p><p>~EC2 Instance: Stands for Elastic Compute Cloud which is a virtual server inside the AWS Cloud.</p><p>~ Sudo: Allows you to run commands as if you are the root user in a terminal.</p><p>~ Terraform: Hashicorp Language that uses Infrastructure as Code and works with different providers to create resources, such as AWS.</p><p>~ Monolith: When the functions of a program are not easily changeable, they are hardcoded.</p><h3>Prerequisites:</h3><p>~ Basic AWS Knowledge.</p><h3>Setting Up Cloud9 Environment</h3><p>If you already have a Cloud9 environment set up, you may skip this step.</p><p>Login to your AWS Console and head to Cloud9 and Create a new Environment. You only need to add a name to the environment, the description is optional, keep the remaining settings default.</p><p>Create your environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u6uOo-WeOr8oFE9JA02i-A.png" /></figure><p>Once you are inside your Cloud9 environment you need to create a new folder to hold all of your files for this project.</p><p>I named my folder Week20, but you can name yours whatever you want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/189/1*MpeShODcIK_CzycG421B_Q.png" /></figure><p>Now in your terminal cd to the location of your folder.</p><pre>cd &lt;folderlocation&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*0IeQwioRAdBrz1XtZfoGhQ.png" /></figure><p>You need to make multiple files inside this folder, so we do not hardcode any information. Inside of your Folder you need to create 4 files: main.tf, variables.tf, providers.tf, and script.sh.</p><pre>touch main.tf variables.tf providers.tf script.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VjqcwcfhUpZKRm1uV88h0w.png" /></figure><h3>Provider.tf</h3><p>To inform Terraform the provider we are using we need to input information about the AWS provider, inside the providers file paste the following:</p><pre>terraform {<br>  required_providers {<br>    aws = {<br>      source = &quot;hashicorp/aws&quot;<br>      version = &quot;5.9.0&quot;<br>    }<br>  }<br>}<br>provider &quot;aws&quot; {<br>    region = &quot;us-east-1&quot;<br>}</pre><p>This tells Terraform what source to get and what version of the provider to use. For the region you may need to change the location to the region that is closest to you.</p><h3>Variables.tf</h3><p>We will now edit the Variables file. Inside this file holds variables, we will input into our main.tf file. This file is important so we do not hard code our main.tf file so it will be easier to transport and edit later. I placed # over the different variables to give a breakdown of what the variables mean.</p><pre>#This variable will be the name of your ec2 instance<br>variable &quot;name&quot; {<br>  type    = string<br>  default = &quot;Jenkins&quot;<br>}<br><br>#This variable contains your availability zone <br>variable &quot;az&quot; {<br>  type    = string<br>  default = &quot;us-east-1a&quot;<br>}<br><br>#This variable you need to input your default VPC, it must be DEFAULT<br>variable &quot;vpc_id&quot; {<br>  type    = string<br>  default = &quot;&lt;INSERTYOURDEFAULTVPC&quot;<br>}<br><br>#This variable is the instance type you will be using<br>variable &quot;type&quot; {<br>  type    = string<br>  default = &quot;t2.micro&quot;<br>}<br><br>#This is your globally unique bucket name, meaning it has never been used<br>variable &quot;bucket&quot; {<br>  type    = string<br>  default = &quot;&lt;INSERTUNIQUEBUCKETNAME&quot;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*KgUenjh__jNeg70GkCpPkg.png" /></figure><h3>Script.sh</h3><p>Next, we need to edit our script.sh file. This is going to be a bash script. We will be updating our ec2 instance and installing Jenkins so we can access it from our browser. This is the same information we would put inside a user data field if we were making our EC2 instance inside the AWS Console.</p><p>I have placed inline comments to provide what the sections mean.</p><pre>#!/bin/bash<br>#Updates the EC2 Instance<br>sudo apt-get update -y<br>#This is installing a java implementation<br>sudo apt-get install openjdk-11-jre -y<br>#Adds the jenkins repository<br>sudo curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc &gt; /dev/null<br>sudo echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list &gt; /dev/null<br>sudo apt-get update -y<br>sudo apt-get install fontconfig openjdk-11-jre -y<br>#These commands install Jenkins<br>sudo apt-get install jenkins -y<br>sudo systemctl start jenkins<br>sudo systemctl enable jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WC5dWMRtcG-VBh96yiBhPQ.png" /></figure><h3>Main.tf</h3><p>Last but not least it is time to edit our Main.tf file, this is the primary file that houses all of the important information. I am going to break down the sections of this file for proper understanding. I have placed inline comments to provide insight on the different resource sections.</p><pre>/*<br>This is create an ec2 instance, we input the variables using var.&lt;inputvariable&gt;<br>I used an ubuntu AMI, and provided the security groups we will create below<br>For the user_data we input the script file we made above to install jenkins<br>The tag is going to be the instance name (Jenkins)<br>*/<br>resource &quot;aws_instance&quot; &quot;ec2&quot; {<br>  ami               = &quot;ami-053b0d53c279acc90&quot;<br>  instance_type     = var.type<br>  availability_zone = var.az<br>  security_groups   = [aws_security_group.project.name]<br>  user_data         = file(&quot;script.sh&quot;)<br>  tags = {<br>    Name = var.name<br>  }<br>}<br>/*<br>This begins the creation of a new security group we will use for the instance<br>Using the vpc variable<br>*/<br>resource &quot;aws_security_group&quot; &quot;project&quot; {<br>  name   = &quot;Allow SSH/TCP Traffic&quot;<br>  vpc_id = var.vpc_id<br>//This creates our inboud rules for our security group<br>  ingress {<br>    from_port   = 22<br>    to_port     = 22<br>    protocol    = &quot;TCP&quot;<br>    cidr_blocks = [&quot;0.0.0.0/0&quot;]<br>  }<br>  ingress {<br>    from_port   = 8080<br>    to_port     = 8080<br>    protocol    = &quot;TCP&quot;<br>    cidr_blocks = [&quot;0.0.0.0/0&quot;]<br><br>  }<br>  ingress {<br>    from_port   = 443<br>    to_port     = 443<br>    protocol    = &quot;TCP&quot;<br>    cidr_blocks = [&quot;0.0.0.0/0&quot;]<br>  }<br>//This creates our outbound rules for the security group<br>  egress {<br>    from_port   = 0<br>    to_port     = 0<br>    protocol    = &quot;-1&quot;<br>    cidr_blocks = [&quot;0.0.0.0/0&quot;]<br>  }<br>}<br>//This is going to make our S3 bucket for the Jenkins Artifacts<br>resource &quot;aws_s3_bucket&quot; &quot;bucket&quot; {<br>  bucket = var.bucket<br><br>  tags = {<br>    Name = &quot;Jenkins project&quot;<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*2ApP9RZEEFP6sNq86Zyy5Q.png" /></figure><p>Run this command to correct any incorrect formatting inside the terraform files.</p><pre>terraform fmt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BqNZF5xF1XKzNqEYO--z1w.png" /></figure><h3><strong>Start it up!</strong></h3><p>In your terminal run a terraform init. This initializes the process and checks for the proper providers needed to run your files.</p><pre>terraform init</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*g0RxJl2ga_Ef13cUdNTV1g.png" /></figure><p>Once the init is completed run, terraform plan. This allows you to see what you will be creating; you can review and see if there are any mistakes.</p><pre>terraform plan</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WAtZXvzcmhCbudYDfLReLA.png" /></figure><p>After seeing the details of your plan, you can now start running your code.</p><pre>terraform apply -auto-approve</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*ncye8thx1L3KeIHkQtJH9w.png" /></figure><h3><strong>Verify Jenkins</strong></h3><p>We now need to make sure we can reach our Jenkins webpage. Return back to the AWS Console and retrieve the public IP that is attached to your newly created instance, paste the IP into your browser followed by the port number,<strong> :8080</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*dZSMweuPG6shmDsDtgYfBg.png" /></figure><pre>&lt;YOURIPADDRESS&gt;:8080</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BNGreduvDHNGhdMeUvLShQ.png" /></figure><p>You have successfully connected to a Jenkins webserver using Terraform.</p><p>For more, easy to follow articles, follow me on Medium!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91f33b5e8fe6" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/jenkins-installation-inside-an-ec2-instance-using-terraform-91f33b5e8fe6">~Jenkins installation inside an EC2 instance using Terraform~</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[~Scaling and Stacking with Docker~]]></title>
            <link>https://medium.com/@asontidg/scaling-and-stacking-with-docker-d278839c59d?source=rss-f55ba76d5975------2</link>
            <guid isPermaLink="false">https://medium.com/p/d278839c59d</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[container-orchestration]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Asonti Ginn]]></dc:creator>
            <pubDate>Thu, 13 Jul 2023 16:02:17 GMT</pubDate>
            <atom:updated>2023-07-18T02:41:35.749Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*zu76-k6vb5Ku5OVdp1vYFg.png" /></figure><h3>Today’s Goals</h3><p>~ Create a docker service.</p><p>~~ Scale out our created service.</p><p>~ Create a Docker Stack.</p><h3>Key Terms</h3><p>~ Docker: With docker you can build, update, and run containers.</p><p>~ Container: A container is made from an image, and it packages up code so it can run quickly in other environments.</p><p>~ Swarm: This is a service provided by docker that helps with container orchestration.</p><p>~ Node: An instance inside a docker swarm.</p><p>~ Sudo: Allows you to run commands as if you are the root user in a terminal.</p><p>~ Docker Stack: Allows multiple services to be distributed across your Docker Swarm.</p><p>~ NGINX: An open-source web server and is used to host websites.</p><h3>Prerequisites</h3><p>~ Have a Docker swarm environment. If you need help setting up your swarm environment, check out my other easy to follow article. <a href="https://medium.com/@asontidg/setting-up-a-docker-swarm-environment-c78422c2ad56">setting-up-a-docker-swarm-environment</a></p><h3>SCALING OUTTT</h3><p>Before we can scale a service, we need to create one. I will break down the following command for better understanding, this will make a simple nginx webpage service.</p><p>~ - - name: The name of the service we are going to create.</p><p>~ -p 80:80: This is the port number we will be running.</p><p>~ nginx: The web service that will appear in port 80:80.</p><pre>sudo docker service create --name &lt;SERVICENAME&gt; -p 80:80 nginx</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*seSZ9BQpHB5OrfVkMrgBnQ.png" /></figure><p>We need to be sure our service is running, run the following command to check on the status of your service.</p><pre>sudo docker service ps &lt;SERVICENAME&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*7QREX6UUh-4jrKSSFbvEuQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/107/1*zkXSowGsAnUbLxezSsS8HQ.png" /></figure><p>Run your IP address to verify you can reach your nginx page. Be sure to use the correct IP address. This is the public IP of your manager node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*wrs0LyOyow4fDBHindl6BQ.png" /></figure><p>Now let&#39;s scale out and add a few more replicas. We are going to update our service to have 3 replicas, the replicas should distribute across all your nodes.</p><pre>sudo docker service update &lt;SERVICENAME&gt; --replicas 3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*gwMpIuS94adcdGjea0FVBQ.png" /></figure><p>Once your service finishes updating you want to check the status of your service. With the following command we can view if they are running, how long they have been running, and their location in reference to the nodes.</p><pre>sudo docker service ps &lt;SERVICENAME&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*gL4q_yL2tcHOhQCuomEp3g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/80/1*mIrmH_ygjLmVIxa1c5XOEw.png" /></figure><p>Now that our service has been scaled you should be able to reach the nginx page from all three of your IP addresses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*IBrIX9xFIhrurNkciq65WQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*T5yUXAvx6pXoj963tosnVw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*O5Y64trwGdYfpHq1VPUItA.png" /></figure><p>You have successfully scaled your service.</p><p>After you are done with this service you should remove it to save space.</p><pre>sudo docker service rm &lt;SERVICENAME&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*8a2wG_yCnyA9uzugehJRVA.png" /></figure><h3>Stack it Up!</h3><p>Time to create a stack. If you did the scaling project above and have not stopped running nginx on port 80 you do need to stop that before you can deploy your stack. You can type the following command.</p><pre>sudo docker service rm &lt;SERVICENAME&gt;</pre><p>Now we need to write our stack information. Begin by making a new directory then changing to it.</p><pre>mkdir &lt;DIRECTORYNAME&gt;<br>cd &lt;DIRECTORYNAME&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*cHabqRMERo8cQSQrDtwg5Q.png" /></figure><p>Then create a stack file, we need to edit text inside our stack file, so we will use vim to do so.</p><pre>vim stack.yml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*HWEE42bAL-HVrjrHsZh6yw.png" /></figure><p>You should be inside your yml file, it should look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/1*rmgjn9QKfeYBx3ZiaCYt3g.png" /></figure><p>I have provided the contents of the file for you below.</p><p>To edit your yml file hit ‘i’ and then you can begin typing.</p><pre>version: &#39;3.8&#39;<br><br>services:<br>  web:<br>    image: nginx<br>    ports:<br>      - &quot;8080:80&quot;<br>    deploy:<br>      replicas: 3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*dIXgPmNAEpSZ9_R7TpKQ8g.png" /></figure><blockquote>TIP: Be sure that the spacing in your file is correct, this can affect whether or not your stack will deploy.</blockquote><p>Once you have added everything to your file, to stop editing hit the ‘esc’ key. To save and exit the file type “:wq”.</p><p>After exiting the file, you will be returned back to your terminal, it’s stack deployment time.</p><p>Type this command and feel free to name your stack anything you would like.</p><pre>sudo docker stack deploy -c stack.yml &lt;ADD NAME&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*vDpSBpY6c07Sw3f0EKZfog.png" /></figure><p>The stack should be created. We can check the status of the stack 2 ways. This command will show you each node and how long they have been running for.</p><pre>sudo docker stack ps &lt;STACKNAME&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*im9CSDNAIFuZVv6tIlRlLw.png" /></figure><p>This command will show you the number of replicas and what ports are they attached to.</p><pre>sudo docker stack services &lt;STACKNAME&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*NoFffkoXixJRmh7DhhliQw.png" /></figure><p>To verify that your stacks are running, input your IP address of any node followed by the port number. Your Welcome to nginx page should appear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*DjegyrsBF-Mn1EZDs0mMdg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*121LHDmSNS-CClSgaOQ5cQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*dv5GHV3D2WH61KL-tktjAg.png" /></figure><p>You now know how to create a docker stack and how to scale your services!</p><p>For more, easy to follow articles, follow me on Medium!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d278839c59d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[~Setting up a Docker Swarm Environment~]]></title>
            <link>https://medium.com/@asontidg/setting-up-a-docker-swarm-environment-c78422c2ad56?source=rss-f55ba76d5975------2</link>
            <guid isPermaLink="false">https://medium.com/p/c78422c2ad56</guid>
            <category><![CDATA[women-in-tech]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-swarm]]></category>
            <dc:creator><![CDATA[Asonti Ginn]]></dc:creator>
            <pubDate>Wed, 12 Jul 2023 03:42:12 GMT</pubDate>
            <atom:updated>2023-07-12T03:42:12.680Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*0Wua4BApaolnGKQVZj7U-g.png" /></figure><h3>Today&#39;s Goals</h3><p>~ Create 3 Ubuntu instances in AWS with docker installed.</p><p>~ Use Visual Studio Code to SSH into our instances.</p><p>~ Create our Swarm and add our Workers.</p><h3>Key Terms</h3><p>~ Docker: With docker you can build, update, and run containers.</p><p>~ Container: A container is made from an image, and it packages up code so it can run quickly in other environments.</p><p>~ VS Code: A code editor and it offers many extensions to make VS Code run like an IDE.</p><p>~ Ubuntu: Ubuntu is a free Open-Source Linux distribution.</p><p>~ Swarm: This is a service provided by docker that helps with container orchestration.</p><p>~ Node: An instance inside a docker swarm.</p><p>~EC2 Instance: Stands for Elastic Compute Cloud which is a virtual server inside the AWS Cloud.</p><p>~ Sudo: Allows you to run commands as if you are the root user in a terminal.</p><h3>Prerequisites</h3><p>~ An AWS Account and basic AWS knowledge.</p><p>~ Visual Studio Code downloaded.</p><p>~ Basic Command Line knowledge.</p><h3>Instance Set Up</h3><p>Begin by logging into AWS, go to your EC2 console, and launch a new set of instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*Fx-cF8juUxuj5RIoqKSbTQ.png" /></figure><p>Since we are making a multi node environment we need to launch multiple instances. For this project launch 3 and add a common name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BC5d3iGH8Nf2z7ekW10Eeg.png" /></figure><p>Change your default amazon Linux image to an Ubuntu image. We want to keep our project as free as possible so make sure your instance type is t2.micro.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*UfnZgXOXqsl2m0v9F_YHMw.png" /></figure><p>If you have a key pair on your computer you would like to use, you can use a previously made one, if not, generate a new key pair.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*vg75KgwPrhGdgZtvB-agow.png" /></figure><p>We need to edit our Network settings. You can keep your instances inside your default VPC be sure to check that your instance will automatically assign a public IP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*oCYIWBAnL8cD6vMu1-8J8Q.png" /></figure><p>We are going to create a new security group to be sure we have all the correct settings we need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*wGetT-VNa9U0OtcAeYKQZQ.png" /></figure><p>Our security group needs 3 rules. We need to allow our computer and VPC access to this environment.</p><p>Add the following rules:</p><p>~ SSH from anywhere.</p><p>~ All traffic from your IP.</p><p>~ All traffic from your VPC CIDR block. You can find this under the name of your VPC. You will have to type this CIDR block in the source box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*PS7vGW8cpFFjBgZuLGCCmg.png" /></figure><p>The last thing we need to add is User Data. At the bottom of your screen open the advanced details and locate the user data field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*eO24lae5ZnRTpcwgTNaMKA.png" /></figure><p>In the user data field add the following information. I will break down the sections for better understanding.</p><p>~ #!/bin/bash: The start of a script, it lets the computer know its executable and to run this information with a bash interpreter.</p><p>~ apt-get install update -y: This updates anything inside the instance so we don’t have to.</p><p>~ curl -fsSL <a href="https://get.docker.com/">https://get.docker.com</a> -o get-docker.sh <br>sh get-docker.sh: These commands will install docker inside each instance so we can create our swarm.</p><pre>#!/bin/bash<br>apt-get install update -y<br>curl -fsSL https://get.docker.com -o get-docker.sh <br>sh get-docker.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*z-dXIr4uruxxpEuQgU8-VA.png" /></figure><p>Once you are done adding your user data you can launch your instances.</p><p>To help with telling the difference between nodes, I suggest you add numbers after the names of your instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*pwnx1BQ6evhZGFPRL9-sLw.png" /></figure><h3>Instance Connection</h3><p>Now it is time to connect to our instances to get them working together.</p><p>Open your VS Code and select the terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*0UmX8G6wJ3mj0pCFVMkx2g.png" /></figure><p>When you open the terminal, you need to see what directory you are in. Your key pair automatically goes to the downloads folder so if you are not there already cd to that directory.</p><pre>cd &lt;insertyourpath&gt;</pre><p>Add 2 additional terminals attached to this terminal, those will be the additional worker nodes later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*og-veykrwww1Oxq8d1mUGQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*BcUi_YHvOv1iGNygFN0Meg.jpeg" /></figure><p>Return back to your AWS Console and select your first node. Click connect and select SSH Client. Copy the Example at the bottom of the ssh client.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/219/1*NeNFjqtOXEEn3bIDuV7OIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*2hyU5fdmqa0ymkxybuthAQ.png" /></figure><p>In your VS code terminal paste the example into your first terminal. You will be asked for a fingerprint, type yes and you should now be ssh into your instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*ZiVeAW3dpfbYtEwKVhbsPg.png" /></figure><p>We have successfully ssh into our first instance. Repeat the same process for both your remaining instances.</p><p>Once you have ssh into all your instances your screen should look similar to this. I did clear my screen to make the picture more visually appealing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rPNEWx7SVwXyVC_JHe3SYw.png" /></figure><p>Inside each terminal run the following command to be sure docker is installed properly. It will tell you what version of docker you have installed as well as additional docker information.</p><pre>sudo docker version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-PB8RcTEDTkyTrbgq3iMhg.png" /></figure><h3>SWARMING TOGETHER</h3><p>Now we need to create our swarm, add our manager, and workers to the swarm. But before we can do that lets rename our terminals so we can know the difference between each.</p><p>I used the names: manager, node1, and node 2. You can name your nodes anything you would like.</p><pre>sudo hostnamectl set-hostname &lt;INSERTNAME&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KNBUtkymA0LOU89d7RqkPg.png" /></figure><p>After running this command in each terminal, we need to reboot the terminals so the name can appear. Be sure to run this command in each terminal not just the first one or only the first name will change.</p><pre>sudo reboot</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*hOsluvbhLOMACL1e3R6S9A.png" /></figure><p>Now we need to connect back, to make it simple click on the terminal and hit the up arrow until the ssh command returns back on the screen and run it.</p><p>You should see that all your terminals have been named with the proper name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T4wkG8j1PWZzSS_kdoenBQ.png" /></figure><p>We finally get to set up our swarm. Return back to AWS and go to your manager instance, in my case this is ‘NODE1’. Retrieve the Private IP address and copy it to your clipboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gbsLcntWBHT2HHnBhMgueg.png" /></figure><p>In your manager terminal paste the following command:</p><pre>sudo docker swarm init --advertise-addr &lt;PASTEYOURIP&gt;</pre><p>This command makes this terminal the manager of docker swarm. It will push out a command that we will use in the nodes to add them to the swarm and establish them as workers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*2slfzx_N1lyz4A74EA8VMw.png" /></figure><p>Copy your swarm token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*CebDQu5JRfKceqL0hgCQLg.png" /></figure><p>In the nodes type sudo then paste the token and it should now make the nodes workers.</p><pre>sudo &lt;COPIEDTOKEN&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NwicHHZHGgr6zqBrybK4GQ.png" /></figure><p>Now let&#39;s check to make sure the manager can see the nodes available.</p><pre>sudo docker node ls</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*RmHglEyerLlaTyRx9BWVaA.png" /></figure><p>All your nodes are now set up and ready to go!</p><p>For more, easy to follow articles, follow me on Medium!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c78422c2ad56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[~Installing Jenkins with Docker ~]]></title>
            <link>https://medium.com/womenintechnology/installing-jenkins-with-docker-a3d7439169d2?source=rss-f55ba76d5975------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3d7439169d2</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <dc:creator><![CDATA[Asonti Ginn]]></dc:creator>
            <pubDate>Wed, 05 Jul 2023 14:55:18 GMT</pubDate>
            <atom:updated>2023-07-13T12:51:12.896Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-T2DwYzAeV73ycO08enIsg.png" /></figure><h3>Today&#39;s Goals</h3><p>~ Create a volume for our Jenkins image to persist its data.</p><p>~ Create a container using the new volume.</p><p>~ Retrieve the Admin password and create a new Jenkins user.</p><p>~ Create a new container to verify the new user has been created successfully.</p><h3>Key Terms</h3><p>~ Docker: With docker you can build, update, and run containers.</p><p>~ Container: A container is made from an image, and it packages up code so it can run quickly in other environments.</p><p>~ Jenkins: Jenkins is an open source web server that can be used for automation. This is considered a continuous integration tool.</p><p>~ Volume: Dockers own type of file system, there are 2 types of volumes.</p><p>~~Named Volume: These have a name that you specify in a command and can be used with multiple containers.</p><p>~~Anonymous Volume: These are randomly named by docker and mounted to your container.</p><p>~ Sudo: Allows you to run commands as if you are the root user in a terminal.</p><h3>Docker Benefits</h3><p>~ Scalability: If there is an increase in traffic you can scale to handle more traffic by running multiple containerized apps.</p><p>~ Version Control: Since Containers are made from images, we can have different image versions that we can go back to if needed.</p><p>~ Portability: Makes it easier to be moved through different stages and environments.</p><h3>Prerequisites</h3><p>~ A docker environment. If you do not have one, check out my article to help set up one. <a href="https://medium.com/womenintechnology/setting-up-an-environment-to-run-docker-bdff29882aef">setting-up-docker</a></p><p>~ Basic command line knowledge.</p><h3>Container Creation</h3><p>Before we can get the ball rolling, we need to pull our Jenkins image. If you check Docker Hub for Jenkins, you will see that Jenkins had been deprecated. We cannot use the supported tags but instead we need to use jenkins/jenkins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*E-lrpN21glZMqpVjLbKLSg.png" /></figure><p>So, let&#39;s pull our Jenkins image. Run the following command.</p><pre>sudo docker pull jenkins/jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*kHbPmHevgXLbNEsqEJbl6Q.png" /></figure><p>Since your image has downloaded, we now want to find out what port our image uses.</p><pre>sudo docker inspect jenkins/jenkins</pre><p>After running that command data should be printed in your terminal. Find the “ExposedPorts”. You can see we have 2 ports 8080 and 50000, these will be the two ports we list when we run our container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*0PWFUzYNQe4cG1sdwogY2w.png" /></figure><p>Now that we have obtained the port numbers, we can start the creation of our container. In the command we will run we will also create our own volume that will hold our containers data. I will give a small break down of our command to run our container.</p><p>~ -it: This allows you to interact insides the container.</p><p>~ -d: This means that the container will run in the background.</p><p>~ -p 8080:8080 This specifies the port number; in this case we have 2 ports.</p><p>~ -v jenkins:/var/jenkins_home: This is our volume; we are creating our own volume. Before the colon represents the name of the volume. After the colon represents the location of the volume.</p><pre>sudo docker container run -d -it -p 8080:8080 -p 50000:50000 -v jenkins:/var/jenkins_home jenkins/jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*_BBwUvvzBLH6QsGnY5zrQg.png" /></figure><p>Let&#39;s check our volumes, you should see the name of the volume we made in the command above.</p><pre>sudo docker volume ls</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*4Esbfe9yfHcushSe6miK9g.png" /></figure><p>Now check to make sure your container is running correctly.</p><pre>sudo docker container ls</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ATW43PqQmULqif_LbT0dA.png" /></figure><h3>Signing into Jenkins</h3><p>Time to load up our webpage. You can input your IP address or type localhost into your browser.</p><p>You should see the Jenkins webpage.</p><p>As you can see Jenkins is asking for an Administrator Password, we need to return back to our terminal and retrieve the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*50fam2gtDdLWAq1aGFUhsg.png" /></figure><p>In the screenshot above and on your unlock Jenkins webpage, it states that we can get the password from the /var/jenkins_home/secrets/initialAdminPassword file. Let&#39;s cat out this file, in the terminal paste this command, this will provide you with the Administrator Password.</p><pre>sudo docker exec &lt;CONTAINERID&gt; cat /var/jenkins_home/secrets/initialAdminPassword</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*5ePhYq_cZ-oyR0mjkOq6Rw.png" /></figure><p>Return back to your browser and enter the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*r1IdFhZd83QLi15ZS_1EZg.png" /></figure><p>After unlocking Jenkins, you should be given the option to customize and install Jenkins. To make this easy select Install suggested plugins and it will begin to install everything you need automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*Pf-pUHHFu2-c9wW_5B442g.png" /></figure><p>Create the admin user, for this section I used my own personal information. You want to make sure you memorize this information. We will not use this login again during this process, but you may need it for yourself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*A78zau9ZpM5AiNCzb3qETA.png" /></figure><p>The next step that appears on your screen please skip.</p><p>After skipping the last step your Jenkins should be ready to go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*dqyluA7fEj2Iu2OqDlxBHw.png" /></figure><h3>Create User</h3><p>Once your Jenkins has loaded to your dashboard it is now time to create our user. We need to go to manage Jenkins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*GOW4jBoer-893eipSZNEpA.png" /></figure><p>In manage Jenkins you will find a lot of options, but we only need to create a user. Under security find ‘Users’ and then Create a user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f9nqkPuUqw2-upzbdmfBvw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*Y8qr9I8MrYGQRQk4wnYFeg.png" /></figure><p>For security purposes I will not display a picture of the next step but customize your user to your liking. Be sure to remember the username and password, we will be logging in with this user.</p><p>After adding the new user, you should see both your users displayed in the user screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mjDz9sYLZTLqsp8Oi7jA1Q.png" /></figure><h3>New Container</h3><p>We want to create another container to make sure the user we created in Jenkins, is available in another container.</p><p>In order to start running another container on the same ports we need to stop the first container we created.</p><pre>sudo docker container stop &lt;CONTAINERID&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*4mClnpjAkRWis2elurpiIQ.png" /></figure><p>We will run a similar command as last time but this time we will put a name tag. This tag allows you to name your container instead of receiving an auto generated name.</p><pre>sudo docker container run -d -it -p 8080:8080 -p 50000:50000 --name &lt;INSERTANAME&gt; -v jenkins:/var/jenkins_home jenkins/jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g4JQfs9wzJWzJ_XU-BdQoQ.png" /></figure><p>To be sure you used the correct volume, check your volumes there should be no new volumes.</p><pre>sudo docker volume ls</pre><p>Now verify your new container is running.</p><pre>sudo docker container ls</pre><h3>Verify the User</h3><p>We now want to check and make sure our user we created earlier is available to use. Open a new browser and add your IP. The sign in page should load up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OhUMCv38WcWJCQ6V9LAP6w.png" /></figure><p>Sign into Jenkins with the Username and Password I told you to remember.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*tlwbdf4Zsat6iFHj6VUCEQ.png" /></figure><p>Once you sign in you should see you are now logged in as the newly created user!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9g6pWoJSRiJ_YgPcX5E9ag.png" /></figure><p>For more, easy to follow articles, follow me on Medium!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3d7439169d2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/womenintechnology/installing-jenkins-with-docker-a3d7439169d2">~Installing Jenkins with Docker ~</a> was originally published in <a href="https://medium.com/womenintechnology">Women in Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[~Installing Apache in a Container~]]></title>
            <link>https://medium.com/@asontidg/installing-apache-in-a-container-100f3529944?source=rss-f55ba76d5975------2</link>
            <guid isPermaLink="false">https://medium.com/p/100f3529944</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <dc:creator><![CDATA[Asonti Ginn]]></dc:creator>
            <pubDate>Mon, 03 Jul 2023 02:26:44 GMT</pubDate>
            <atom:updated>2023-07-03T02:26:44.727Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*QtnYbzvpPBCvd0HEzIcrwA.png" /></figure><h3>Today’s Goals</h3><p>~ Create an Ubuntu container in Docker.</p><p>~ Update packages and install apache2.</p><p>~ Customize our webpage.</p><h3>Key Terms</h3><p>~ Docker: With docker you can build, update, and run containers.</p><p>~ Apache: Apache is an open-source web server software.</p><p>~ Container: A container is made from an image and it packages up code so it can run quickly in other environments.</p><p>~ Ubuntu: Ubuntu is a free Open-Source Linux distribution.</p><p>~ Network: This lets containers communicate with host and other containers.</p><p>~ HTML: This stands for Hyper Text Markup Language; you can create webpages using this language.</p><p>~ Sudo: Allows you to run commands as if you are the root user in a terminal.</p><h3>Prerequisites</h3><p>~ Have an environment using an EC2 instance. If you do not have one, check out my article to help set up one. <a href="https://medium.com/@asontidg/setting-up-an-environment-to-run-docker-bdff29882aef">setting-up-docker</a></p><p>~ Basic command line knowledge.</p><h3>Container Creation</h3><p>First, we need to create a container that uses an ubuntu image. We want to run this container detached on port 80. Let’s break down the parts of the command.</p><p>~ -it: This allows you to interact insides the container.</p><p>~ -d: This means that the container will run in the background.</p><p>~ -p 80:80: This specifies the port number; in this case it is port 80.</p><p>~ ubuntu:20.04: The specific image we are running.</p><pre>sudo docker container run -it -d -p 80:80 ubuntu:20.04</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*_u0w--8wD_Ps47N-zCJidg.png" /></figure><p>Now that we have made our container, we need to list our containers so we can see our ID and that it is up running properly.</p><pre>sudo docker container ls</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*fFz3w1bK-H5pwTyC-vRJYA.png" /></figure><p>You should see that the container is up running connected to the port we specified above.</p><h3>Installing Apache</h3><p>Next, we need to enter the container and run a few commands so we can install Apache. We need to start a bash shell inside the container.</p><p>~ exec: Allows you to execute a command inside the container.</p><p>~ bash: Bash is what we are executing inside the container.</p><pre>sudo docker container exec -it &lt;ID&gt; bash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*Gs0UtUTqeMzaFDkyK_54UQ.png" /></figure><p>As you can see you now are inside the container and can run certain bash commands. Before we install Apache, we want to make sure that the shell is up to date. This command will run any updates that are needed.</p><pre>apt-get update -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*wAtMW9tzigEMdxyOSKs0TA.png" /></figure><p>Now run this command to install Apache2.</p><pre>apt-get install apache2 -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*1Re08al2suU1GdYlpHt5Kg.png" /></figure><p>While Apache is installing, they will ask for your location and time zone. You can provide the information by typing in the number that corresponds with your correct answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*llwxQlhVB-80NTMxlzPKhw.png" /></figure><h3>Webpage</h3><p>Once Apache is finished installing, we can now edit and create out webpage. The webpage is located in the /var/www/html directory, so we need to head there.</p><pre>cd /var/www/html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*oYYStFUoAca_tVZ3KWOIQg.png" /></figure><p>Inside the directory we want to vim into our index.html file, this file holds our webpage details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*VoruITxBU74mAHeyI-ryjw.png" /></figure><p>If you try to run the vim command, you will see an error saying that command cannot be found. Like I stated earlier we can only run certain commands. So, we must install vim to run the vim command.</p><pre>apt-get install vim -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*m2kxp1DL7IU__b4UYHm-yA.png" /></figure><p>Once vim has been successfully installed, vim into your index.html file.</p><pre>vim index.html</pre><p>When you enter the file you will see a lot of html, type ‘ggdG’, this will clear the entire file.</p><p>Now hit ‘i’ so we can begin entering our html for the webpage.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>        &lt;head&gt;<br>                &lt;title&gt;TYPE YOU BROWSER PAGE NAME HERE&lt;/title&gt;<br>                &lt;h1&gt;TYPE WHAT YOU WANT TO DISPLAY&lt;/h1&gt;<br>        &lt;/head&gt;<br>&lt;/html&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*HeyHRTLZAuetfckyGjNRVw.png" /></figure><p>Once you are finished hit the ‘esc’ button on your keyboard.</p><p>Then type :wq to save your work and exit.</p><p>Run the following command, this will restart your Apache so your updates will be on your webpage.</p><pre>apachectl restart</pre><p>Test your webpage by connecting to your webpage using your IP Address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*q5L2LXiS4Iegy90hBB6A6A.png" /></figure><blockquote>Note: To exit your bash simply type “exit”</blockquote><p>Congratulations, you have successfully made an Apache webpage inside a container.</p><h3>Try something COMPLEX!</h3><p>Let’s try something a little more complicated. We are going to create a new network and run this container we just made in the new network.</p><p>First, we need to create the network.</p><pre>sudo docker network create &lt;NETWORKNAME&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*rtmp2LtobxQb8ZU-1jEI0g.png" /></figure><p>Let’s inspect the container we made above to see what network it is already a part of.</p><pre>sudo docker inspect &lt;CONTAINERID&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*7KCsQeNglGxrIqh3j7cEew.png" /></figure><p>You should see the Networks and the name right below is the network it is connected to; in my case my container is connected to the ‘bridge’ network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*X5RncDnRE70UJ2Wo5Kzu1A.png" /></figure><p>We want to add our container to our newly created network.</p><pre>sudo docker network connect &lt;NETWORKID&gt; &lt;CONTAINERID&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*fctuKGtOqGLE67vxxyeAXw.png" /></figure><p>We need to disconnect from the default network we are still attached to. We need to list the networks so we can retrieve the network ID of the default attached network. Copy the Network ID.</p><pre>sudo docker network ls</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*0pBnfvlC_WHj0tmQZC2R0Q.png" /></figure><p>Now disconnect your container from that network and inspect after to be sure you disconnected successfully.</p><pre>sudo docker network disconnect &lt;PASTENETWORKID&gt; &lt;CONTAINERID&gt;</pre><pre>sudo docker inspect &lt;CONTAINERID&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*Lc_s21NORAbH9BsYK9J83g.png" /></figure><p>You should now see that the only network your container is connected to is the one you just made.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*hLds0iXlM_qPD-n3_iUcyw.png" /></figure><p>You have successfully added your container to a new network.</p><p>For more, easy to follow articles, follow me on Medium!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=100f3529944" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[~Setting up an Environment to run Docker~]]></title>
            <link>https://medium.com/womenintechnology/setting-up-an-environment-to-run-docker-bdff29882aef?source=rss-f55ba76d5975------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdff29882aef</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Asonti Ginn]]></dc:creator>
            <pubDate>Mon, 03 Jul 2023 02:23:47 GMT</pubDate>
            <atom:updated>2023-07-03T10:30:09.429Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*6evB4jC9ahfC4lDwpeh_MQ.png" /><figcaption>Collageb by the author.</figcaption></figure><h3>Today’s Goals</h3><p>~ Create an Ec2 Instance.</p><p>~Connect to the EC2 instance and install docker.</p><p>~ Optional: Connect to your docker environment through VS Code.</p><h3>Key Terms</h3><p>~EC2 Instance: Stands for Elastic Compute Cloud which is a virtual server inside the AWS Cloud.</p><p>~ VS Code: A code editor and it offers many extensions to make VS Code run like an IDE.</p><p>~ Ubuntu: Ubuntu is a free Open-Source Linux distribution.</p><p>~ Sudo: Allows you to run commands as if you are the root user in a terminal.</p><p>~ Docker: With docker you can build, update, and run containers.</p><h3>Prerequisites</h3><p>~ An AWS Account.</p><p>~ Basic terminal knowledge.</p><h3>Creating an Instance</h3><p>Begin by logging into your AWS account and going to EC2 in the console.</p><p>Launch an instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*Bj98LzykVy9bYMaAm4sqBg.png" /></figure><p>Add a name and set the AMI to Ubuntu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*HN1DI2kQnfxvJdmHTuCU-g.png" /></figure><p>We want our project to remain free so set your instance to t2.micro.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*JExxTblT4Efn5m_-2cQbCQ.png" /></figure><p>Create a new key pair, this will download to your downloads folder on your computer.</p><p>When creating the new key pair keep the key pair type RSA and .pem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*kJyEn0WY0_zps0LlRBQitQ.png" /></figure><p>We will keep our instance inside our default VPC, but we need to create a new security group. This security group needs to allow SSH traffic. If you want this security group to be named, select edit at the top right corner of the box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*adhqKocRZII4IwmOnxBGCA.png" /></figure><p>Once you finish your Network settings you can launch your instance.</p><p>Before we go into our instance, we need to check some security settings.</p><p>Click on your instance security settings you need 2 inbound rules. One for SSH and the other for All traffic. Your SSH should be from Anywhere and All traffic should be set to your IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKEWSbGO31ROUnjwr9CqBg.png" /></figure><p>If your settings are not like mine select the security group button in the inbound rules and add the other rules.</p><h3>Install Docker</h3><p>Wait until your instance no longer displays pending and the status changes to running. Click on your instance and select ‘Connect’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*cwE7njPs9zGoJFRP0nQrIQ.png" /></figure><p>We are going to SSH into our environment, so under SSH Client, copy the example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*q3Tcgo6JDz412MfO8-1Tfw.png" /></figure><p>On your computer enter your power shell. You need to cd to the directory that is holding the key pair you created. If you did not move your keypair it will automatically go to your downloads folder.</p><p>In power shells, enter the following command to change to your downloads folder.</p><pre>cd Downloads</pre><p>If you did move your keypair, locate the folder on your computer, copy the path and type the following command.</p><pre>cd &lt;YOURPATH&gt;</pre><p>After entering your folder, we now want to paste in the SSH command we copied earlier. It will ask about a fingerprint type ‘yes’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*heL5wmgjz7wzj2aORaXdAA.png" /></figure><p>You should now be inside your Ubuntu instance; we want to make sure everything is updated so let&#39;s call an update.</p><pre>sudo apt-get update -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*chzdZRBanfJl3ofT-YkdFQ.png" /></figure><p>Time to install docker, paste the following commands.</p><pre>curl -fsSL https://get.docker.com -o get-docker.sh</pre><pre>sh get-docker.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S-lHtFifimIBDAw7kAPSHA.png" /></figure><p>To be sure docker is installed correctly run docker version to tell you the version of docker that is installed.</p><pre>sudo docker version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*nHAxSztJMUhfvrOtKGp5Mw.png" /></figure><p>You have now installed Docker on your EC2 Instance.</p><h3>Optional: VS Code</h3><p>You can download Visual Studio Code in your desktop&#39;s app store.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*otGuyH5-6cLCM2BaNzQR2Q.png" /></figure><p>Inside of VS Code we need to install certain extensions to make our Docker experience a whole lot simpler. Select the extensions tab on the left side to begin downloading everything we need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*MkemJRwYq-IWJPS0AOq9ZQ.png" /></figure><p>Download all of the following extensions:</p><p>~ Docker</p><p>~ Git lens</p><p>~ Remote SSH</p><p>~Kubernetes</p><p>~ YAML</p><p>~ Remote Development</p><p>After installing all of the extensions, in the top left corner select file and open a folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*6ymRfBT0Ts712KhVuXUR0w.png" /></figure><p>In your files you need to locate your .ssh folder, this folder is usually located in the users folder. To find the users folder select your local drive. Then inside users, click the .ssh, and use this folder to open in VS code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/265/1*aVmZMzpQeSZjh3APv2EERQ.png" /></figure><p>If you receive this pop up about trusted authors, you can trust the authors of your own files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*NlW20cQ0ET1treFKJFGPpQ.png" /></figure><p>We need to add a file to our folder, this will be our config file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*5okBkOCqLYkYkTacMFMuig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*y3cAJrybRV74Ow6KexFiRg.png" /></figure><p>We will set this file up to enable us to connect to our instance in VS Code.</p><p>You will need to paste your instance IP as well as the path to your keypair in the code below.</p><pre>#DOCKER FILE<br>Host DOCKER<br>    #Change your IP Address every time you connect<br>    HostName &lt;YOURIPADDRESS&gt;<br>    User ubuntu<br>    IdentityFile C:\&lt;YOURPATH&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*RyTb5KjsfrE6ecAuA_qV6w.png" /></figure><blockquote>NOTE: EVERY TIME YOU WANT TO ENTER YOUR INSTANCE, YOU MUST PUT YOUR NEW IP ADDRESS, YOU WILL NOT HAVE TO RETYPE THE ENTIRE FILE.</blockquote><p>Save your file and select this button in the bottom left corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/258/1*evGaSfBO06zG6cprcdTy0w.png" /></figure><p>This will put a prompt on the top of your screen select ‘Connect to Host’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*HML23JuCTPE9Hzfk0XkJlA.png" /></figure><p>In our config file we specified that our Host is Docker. An entire new VS Code will open and put you inside our Ubuntu instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*KdeZMojZ6D5o-khOv1AGqw.png" /></figure><p>When it asks for your platform select Linux and if a continue option appears do select continue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*82CPsNP0uiyp3L1jH7BxHA.png" /></figure><p>Once everything is loaded your bottom left corner should now show that you have ssh into you docker environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/119/1*QrG1lKNWs3OcfxZss88IQQ.png" /></figure><p>On the top of your screen open a new terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*YhpemP9I5-Jm9kScr7Djzg.png" /></figure><p>Run the command to check your docker version again.</p><pre>sudo docker version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*S9b4zdKQKaiTFaYkDcp6QA.png" /></figure><p>As you can see you have successfully created a docker environment.</p><p>Want to try some cool things with docker? Check out my beginner friendly article where I help you make Docker containers and install things in the Container. <a href="https://medium.com/@asontidg/installing-apache-in-a-container-100f3529944">installing-apache-in-a-container</a></p><p>For more, easy to follow articles, follow me on Medium!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bdff29882aef" width="1" height="1" alt=""><hr><p><a href="https://medium.com/womenintechnology/setting-up-an-environment-to-run-docker-bdff29882aef">~Setting up an Environment to run Docker~</a> was originally published in <a href="https://medium.com/womenintechnology">Women in Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[~CI/CD with AWS~]]></title>
            <link>https://awstip.com/ci-cd-with-aws-87b2fb80e86e?source=rss-f55ba76d5975------2</link>
            <guid isPermaLink="false">https://medium.com/p/87b2fb80e86e</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Asonti Ginn]]></dc:creator>
            <pubDate>Thu, 29 Jun 2023 20:34:55 GMT</pubDate>
            <atom:updated>2023-11-16T11:04:17.568Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*lJw5Xri4hBv9pwqnWWlNRQ.png" /></figure><h3>Today’s Goals:</h3><p>~ Use AWS Code Commit to create a repository.</p><p>~ Create a S3 bucket and allow static website hosting.</p><p>~ Make a Code Pipeline to automate our updates on our site.</p><h3>Key Terms</h3><p>~ Code Pipeline: Allows automation for your applications.</p><p>~ CI/CD: Continuous Intergration and Continuous delivery</p><p>~Repository/Repo: Holds files used to track progress throughout a project.</p><p>~S3 Bucket: S3 stands for Simple Storage Service, this holds your objects, it is very durable, and can hold basically any type of data.</p><p>~ Code Commit: Keeps track of your updates on your files in your repository.</p><h3>Prerequisites</h3><p>~ An AWS Account.</p><h3><strong>CI/CD Benefits</strong></h3><p>~ Faster releases.</p><p>~ Cost reduction.</p><p>~ Easier to detect bugs.</p><p>~ Easier monitoring.</p><h3>Video</h3><p>Here is my video version of this project.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F73ggNI35bZ4&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D73ggNI35bZ4&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2F73ggNI35bZ4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/189748573e893a13383dae640de359b4/href">https://medium.com/media/189748573e893a13383dae640de359b4/href</a></iframe><h3>Website File</h3><p>I will provide the code I will be putting inside my file for my repo. If you do not know how to make a file that has html inside, click this link. <a href="https://medium.com/@asontidg/create-a-static-website-using-s3-and-cloudfront-11a5ac98c99b">static-website</a>. That link will also show you how to make a site that is not as basic as the one provided below.</p><pre>&lt;h1&gt;Hello Level Up In Tech!&lt;/h1&gt;<br>&lt;h3&gt;Anyone can transition to DevOps. The steps are: &lt;/h3&gt;<br>&lt;ol&gt;<br>    &lt;li&gt;Trust the process&lt;/li&gt;<br>    &lt;li&gt;Work hard &lt;/li&gt;<br>    &lt;li&gt;Be consistent&lt;/li&gt;<br>    &lt;li&gt;Stay Hungry&lt;/li&gt;<br>&lt;/ol&gt;</pre><h3>Repository</h3><p>We are going to begin by making a repository inside of Code Commit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*wGGzjtAkcUg1UInVEXocTA.png" /></figure><p>For now, you only need to add a repository name but if you wish to add a description feel free to write one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*WlsHEiorMORFSESuLLgB7w.png" /></figure><p>Once you have created your repository, we need to input our html website file inside.</p><p>Select Add file and upload it to the repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*VGgMHXuMfkmrZYIHKPJvcQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*9JN_cleBt7d2mdhRHDUizA.png" /></figure><p>Then add your name as Author, input your email address, and commit your changes.</p><h3>Site Hosting</h3><p>To host a site, we must first create our bucket to host our website in. Go to S3 in the AWS Console and create a bucket. Begin by adding a bucket name and making sure the bucket is in the region closest to you.</p><blockquote>NOTE: The bucket name must be globally unique.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/214/1*kQJNAKrn3GLs6KzROrvrAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*xHW4ef475AM8cxzNuhFH4g.png" /></figure><p>Enable ACL’s and allow public access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*MYtSB0MtIY8DLZWGA3sXsg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*lsLkNw1oqatDqWd5njg9gA.png" /></figure><p>Once it is created click on your bucket name, and Upload file.</p><p>Add the same file we added to your repository, to your bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*Ug4gLklPO2W13Pe2P7VWBg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*HP37E3TfhsRc83_PnKe7HA.png" /></figure><p>Now, enter your bucket properties, scroll down until you see static website hosting. Click edit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*Tamu9PTypPBq5CF9jdqt3A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LlBPd8Juu2Wdj1RB_77wVA.png" /></figure><p>Click enable, then in the Index document box, add the file name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*t-QZAGxE3MbhS232MbHJYA.png" /></figure><h3>Pipeline</h3><p>We will start the pipeline by going to Code Pipeline and selecting Create pipeline. Allow pipeline to create a new service role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*FaHt6wsbCZObbjpR4_R0iA.png" /></figure><p>Select Next, we want our Repository to be the Source Stage. Keep the other settings default.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*LhCQeXwcxNw2HaUUa-S_Aw.png" /></figure><p>For this project we will be skipping the Build stage.</p><p>Deploy Stage we will configure to use the S3 Bucket and object key is our html file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*P9vlZ2kYZMoMyeZlkZ665A.png" /></figure><p>Make sure to select Extract file before deployment otherwise your website will not work and will download any time you try to run it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*VRJCRsM0Rf6YkBa_8uDKbg.png" /></figure><p>Review your pipeline then create.</p><p>Wait a few minutes for the pipeline to finish.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*2Sg3qy-vjNJA7F5ZyFhucQ.png" /></figure><h3>Test it Out</h3><p>Let’s check to make sure our website is running correctly. Return back to your S3 bucket. Inside your bucket you will have a new folder containing the website. Open the newly created folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*RrA-Dcbs5q-Us6hc50YFuQ.png" /></figure><p>Open your website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*ud2lfA029MA5-yu_dBV_Ow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*NxpTmO9ksUD0vo7JOPmRCQ.png" /></figure><p>Now let&#39;s go edit code in our repository to be sure the pipeline works. Return back to your repository inside Code Commit and add another line of code.</p><pre> &lt;li&gt;Believe in yourself!&lt;/li&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*s-ijriI3y9ArF5txfCzFIA.png" /></figure><p>Return back to the pipeline and refresh your screen. In the Source you should see that the website has been edited.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*fc2Kvgyew6PkuiXVsEzGEg.png" /></figure><p>Try running your website again, the newly added line of code should be available on your site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*HVoVLI48XPmsoMKfZi68oQ.png" /></figure><p>Congratulations, you now know how to make a pipeline!</p><p>For more, easy to follow articles, follow me on Medium!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87b2fb80e86e" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/ci-cd-with-aws-87b2fb80e86e">~CI/CD with AWS~</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>