<?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 John Labossiere on Medium]]></title>
        <description><![CDATA[Stories by John Labossiere on Medium]]></description>
        <link>https://medium.com/@labossiere01?source=rss-861abfa929ac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hpvTIzLp0d-eUIRiGg44kA@2x.jpeg</url>
            <title>Stories by John Labossiere on Medium</title>
            <link>https://medium.com/@labossiere01?source=rss-861abfa929ac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 08:44:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@labossiere01/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[Deploy A Jenkins Server with Terraform]]></title>
            <link>https://medium.com/@labossiere01/deploy-a-jenkins-server-with-terraform-ae9202b035e7?source=rss-861abfa929ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae9202b035e7</guid>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[John Labossiere]]></dc:creator>
            <pubDate>Sun, 19 Jan 2025 04:51:19 GMT</pubDate>
            <atom:updated>2025-01-19T04:51:19.964Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pIpD4VPDSmPBbcTU.png" /></figure><p><strong>Introduction:</strong></p><p>This project demonstrates how to deploy a Jenkins server on AWS using Terraform to automate infrastructure setup.</p><p><strong>Terraform</strong> is an open-source Infrastructure as Code (IaC) tool by HashiCorp that enables you to define, provision, and manage cloud resources on cloud platforms like AWS and Azure. It automates infrastructure tasks, streamlining deployment and scaling for DevOps teams. With Terraform, you can define resources using human-readable configuration files, making infrastructure management faster, more efficient, and more reliable. By automating the process with code, you eliminate the need for manual management through the cloud console, ensuring a more streamlined and dependable workflow.</p><p><strong>Prerequisites:</strong></p><ul><li>Terraform installed</li><li>Terraform documentation <a href="https://developer.hashicorp.com/terraform">https://developer.hashicorp.com/terraform</a></li><li>AWS account</li><li>GitHub account</li><li>GitHub Desktop installed (not required but it is what I used)</li><li>VScode or code editor</li><li>AWS CLI installed locally.</li></ul><p>To interact with the AWS console from the CLI on your local machine, I followed these steps:</p><ol><li><strong>Created an IAM User</strong>: I made an IAM user in AWS, assigned the necessary permissions, and generated an AWS Access Key and Secret Access Key.</li><li><strong>Installed the AWS CLI</strong>: I downloaded and installed the AWS CLI using the official documentation link. <a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html">https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html</a></li><li><strong>Configured the AWS CLI</strong>: I opened PowerShell on my local machine and ran the <strong>aws configure</strong> command. This allowed me to input the Access Key and Secret Access Key and set up the region.</li><li><strong>Confirm access to AWS: </strong>To verify that your AWS CLI is properly configured, run the command <strong>aws iam list-user</strong>. This command will list the users in your AWS account, allowing you to confirm that you have successfully set up access.</li></ol><p><strong>Here’s the scenario:</strong><br>Your team would like to start using Jenkins as their CI/CD tool to create pipelines for DevOps projects. They need you to create the Jenkins server using Terraform so that it can be used in other environments and so that changes to the environment are better tracked. Below are the steps to follow for the Terraform workflow.</p><ul><li>Deploy 1 EC2 Instances in your Default VPC.</li><li>Bootstrap the EC2 instance with a script that will install and start Jenkins. Review the official Jenkins Documentation for more information:<a href="https://www.jenkins.io/doc/book/installing/linux/"> https://www.jenkins.io/doc/book/installing/linux/</a></li><li>Create and assign a Security Group to the Jenkins Security Group that allows traffic on port 22 from your ip and allows traffic from port 8080.</li><li>Create an S3 bucket for your Jenkins Artifacts that is not open to the public.</li><li>Verify that you can reach your Jenkins install via port 8080 in your browser. Be sure to include a screenshot of the Jenkins login screen in your documentation.</li><li>Push your code to GitHub and include the link in your write up.</li></ul><p><strong>Step 1: Create Github Repository</strong> <strong>&amp; Clone it to Github Desktop</strong></p><p>Log in to your GitHub account, create a new repository, and add a README file. Include a <strong>.gitignore</strong> file and select <strong>Terraform</strong> from the options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*d622Hy3kQsPdHGQUIWYaJw.png" /></figure><p>Open GitHub Desktop, paste the repository URL, and clone it to your local machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*VLBLooX3ias4eR_SHojt6g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*iEe11j58KC5wstEl74stRw.png" /></figure><p>After cloning the repository in GitHub Desktop, click <strong>Open in Visual Studio Code</strong> to access it in VS Code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ROpUDmSb_wGf-kUYZWFalw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*uYRLxddbjh-dFsLHEoSidQ.png" /></figure><p>You can now start configuring the Terraform files in VS Code, and when you’re ready to push your code to GitHub, it will be a smooth process.</p><p><strong>Step 2: Build the .tf Files</strong><br>In Terraform, .<strong>tf files</strong> are used to define resources and settings for managing your infrastructure. Go to the Terraform Registry for guidance on writing the code.<br><a href="https://registry.terraform.io/providers/hashicorp/aws/latest">https://registry.terraform.io/providers/hashicorp/aws/latest</a></p><p>Start by configuring the <strong>AWS provider</strong> in the <strong>provider.tf</strong> file with the region you’ll use for development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*qsKIfNbxZrmY5nIButZFog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*Ng8evAoJAhI0TuavRDQgVg.png" /></figure><p>Notice how the code says <strong>region = var.aws_region</strong>. This works because I created a <strong>variables.tf file</strong> to store the region value, which is us-east-1. I’ll explain more about variable files later.</p><p>Then create a <strong>main.tf</strong> file that will the aws instances, security group, and aws s3 bucket resources</p><p>When creating the aws_instance resource be sure to get the correct ami id from the AWS console first to add to the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*0kzNH4Iu4fIMNf3Znz3LKw.png" /></figure><p>Create and assign a Security Group to the Jenkins Security Group that allows traffic on port 22 from your ip and allows traffic from port 8080.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*1-t9OZ_YECiDnM0yL43I9Q.png" /></figure><p>I create an S3 bucket for my Jenkins Artifacts</p><p><a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket">https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*KMEcr1QTWbzxLasYZbi9_g.png" /></figure><p><strong>Step 3: Jenkins Shell Script</strong></p><p>I created a .sh shell script file called jenkins_script.sh to bootstrap the EC2 instance to install and start Jenkins. Using the Jenkins documentation as a guide. <a href="https://www.jenkins.io/doc/tutorials/tutorial-for-installing-jenkins-on-AWS/">https://www.jenkins.io/doc/tutorials/tutorial-for-installing-jenkins-on-AWS/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*rQKO0DK114q7TK_6bpgm7g.png" /></figure><p><strong>Step 4: Configure Variable files</strong></p><p>In Terraform, a <strong>variables.tf</strong> file is where you define reusable and customizable values, called variables, for your configuration. Think of it as a placeholder for your values. Instead of hardcoding values such as regions or resource names, variables allow you to make your code more flexible and easier to manage across different environments.</p><pre>var.aws_region<br>var.key_name<br>var.ami_id<br>var.my_ip<br>var.security_group_name<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*tf3G4iZOPkS3t12pUrzQsQ.png" /></figure><p><strong>Step 5: Terraform workflow (Init, Plan, Apply)</strong></p><p>Now we will good begin the Terraform workflow which is a sequence of commands used to initialize, review, and apply infrastructure changes in Terraform.</p><p>Begin by running <strong>terraform init</strong> to initializes a Terraform project by downloading necessary provider plugins and setting up the working environment for your configuration files.</p><pre>terraform init<br><br>terraform fmt #format the code per HCL canonical standard<br><br>terraform validate </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*SJPDjVIATqnTM6YOoyJbUQ.png" /></figure><p>Next, run <strong>terraform plan </strong>which<strong> </strong>generates an<strong> </strong>execution plan<strong> and </strong>shows you a preview of the changes Terraform will make to your infrastructure based on your configuration files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vTf8VfgU3VqLB9bjSInP_w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/1*8X3uLqyKSgo-df0Bt3W7Ww.png" /></figure><p>Lastly run the <strong>terraform apply — — auto-approve</strong> command that automatically applies the changes to your infrastructure without asking for confirmation, bypassing the usual approval prompt.</p><pre>terraform apply --auto-approve</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7dX16gd7Klx36jKXyogEGQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*VBC9W83XfuUmomLbFT0Diw.png" /></figure><p><strong>Step 6: Confirm Resources Created Correctly</strong></p><p>To make sure our resources were successfully created let&#39;s go to the AWS console.</p><p><strong>EC2 Instance:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*Axq-AaarmaPtuIDxV_VX9Q.png" /></figure><p><strong>Security Group:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hM4zyBhPGGpqy-67mag_0A.png" /></figure><p><strong>S3 Bucket:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*w6pDSMbaG3FxG-6zlHDzSA.png" /></figure><p><strong>Jenkins:</strong></p><p>To confirm that Jenkins is running. First SSH into the EC2 instance and run:</p><pre>sudo systemctl status jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*x9tN2VIwXA398qGZz4M0-g.png" /></figure><p>The output shows that Jenkins is <strong>active (running)</strong>.</p><p>Take the EC2&#39;s Public IPv4 address:8080 and run it in a web browser for the default Jenkins screen to appear:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*jooFcxiVTGRpp08f7aNKpw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*RRoZJooRTs9t9BcBGkYO5g.png" /></figure><p>Now go back in the EC2 and run the command below to get the default admin password provided for Jenkins:</p><pre>sudo cat /var/lib/jenkins/secrets/initialAdminPassword</pre><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*PZ-phRARX5YutVe1i5Gf9g.png" /></figure><p>Then grow through all the steps to configure Jenkins. Then the dashboard will appear:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BMO6A3qVvm01lN8RZhcf2Q.png" /></figure><p><strong>Step 6: Push all the files to GitHub Account</strong></p><p><a href="https://github.com/john-laboss19/Terraform-Jenkins">GitHub - john-laboss19/Terraform-Jenkins</a></p><p><strong>Step 7: Terraform Destroy</strong></p><p>Once you finish the project, run the <strong>terraform destroy</strong> command to efficiently delete all the resources you created. This streamlined process saves time and ensures everything is cleaned up properly.</p><pre>terraform destroy</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kbHjnIh7glJGjKLg2JMvTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*Cb55vggjXob6AXsIOLtKlQ.png" /></figure><p><strong>Summary:</strong></p><p>I hope this guide was helpful! I walked you through the process of using Terraform to create an AWS EC2 instance, install and run Jenkins, configure security groups, and set up an S3 bucket for Jenkins artifacts.</p><p>Thank you for reading! Feel free to connect with me on LinkedIn and GitHub:<br>🔗 <a href="https://medium.com/www.linkedin.com/in/johnlaboss/">LinkedIn: John LaBoss</a></p><p>🔗 <a href="https://github.com/john-laboss19">GitHub: john-laboss19</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae9202b035e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Continuous Development and 
Deployment with Docker, Jenkins, and Compose]]></title>
            <link>https://medium.com/@labossiere01/continuous-development-and-deployment-with-docker-jenkins-and-compose-60aeb641c7ac?source=rss-861abfa929ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/60aeb641c7ac</guid>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[docker-compose]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[John Labossiere]]></dc:creator>
            <pubDate>Mon, 23 Dec 2024 04:05:19 GMT</pubDate>
            <atom:updated>2024-12-23T14:26:59.634Z</atom:updated>
            <content:encoded><![CDATA[<h3>Continuous Development and Deployment with Docker, Jenkins, and Compose</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jHuZz6TTsVc4U40j.png" /></figure><h4>Introduction</h4><p>Level Up Solutions, a leading provider of technology solutions, is constantly exploring ways to optimize its software development and deployment procedures. The company is keen to adopt tools and methodologies that can streamline their operations, improve productivity, and enhance the quality of their applications. To address these needs, the proposed solution involves leveraging Docker and Jenkins.</p><h4>Prerequisites</h4><ul><li>EC2 instance that has docker installed</li><li>EC2 security group has port 8080 open from your IP address</li><li>SSH into the EC2 instance and run the following command to avoid any permission denials</li></ul><pre>sudo chmod 666 /var/run/docker.sock </pre><h4><strong>Pull the Jenkins LTS image from Docker Hub</strong></h4><p>Go to Docker Hub and search Jenkins to pull the latest Jenkins version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*Be34QBi4sdMOuUVZ2zjL5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KCpbM3qKZhbVzmaOAMil_g.png" /></figure><pre>docker pull jenkins/jenkins:lts-jdk17</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*9HCFARLXsgkAR9VYJ2xTcA.png" /></figure><p>Verify the image was successfully pulled with the command <strong>docker images.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*ermuhSC_rJVfWPok650OXQ.png" /></figure><h4>Create a Docker volume for Jenkins to persist its data</h4><p>Run the following command to create the volume:</p><pre>docker volume create &lt;name of volume&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*L6-Wr3uLW7B7BSXJ4xAaHg.png" /></figure><h3><strong>Create a Docker container with the volume</strong></h3><p>Run the container with the volume and correct port mapped to the container using the command below:</p><pre>docker run -d --name jenkins -p 8080:8080 -v jenkins-v1:/var/jenkins_home jenkins/jenkins:lts-jdk17</pre><ul><li><strong>docker run </strong>starts a new docker container.</li><li><strong>-d </strong>detach mode, allowing you to run the container in the background, so the terminal remains free for other commands.</li><li><strong>- — name jenkins</strong> assigns a name “<strong>jenkins</strong>” to the container.</li><li><strong>-p 8080:8080</strong> maps to Port 8080 on your local machine, then to<br>Port 8080 in the container.</li><li><strong>-v jenkins-v1:/var/jenkins_home </strong>maps the Docker volume named <strong>jenkins_vol</strong> to the <strong>/var/jenkins_home</strong> directory inside the container, ensuring Jenkins’ data (settings and logs) saves, so it won’t be lost if the container stops.</li><li><strong>jenkins/jenkins:lts-jdk17</strong> is the jenkins image that was pulled.</li></ul><p><strong>Verify the container is running:</strong></p><pre>docker container ls</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eYMqHCtoR1N0iZeph4ZUYw.png" /></figure><p><strong>Inspect the container to ensure the volume is correctly mounted:</strong></p><pre>docker inspect c4b4dc84081a</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8MBolQXLT5MgNQi18fh0xw.png" /><figcaption>Verify Container ID</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*uuO47yU17uAGWJujgG-k-A.png" /><figcaption>Scroll down to “Mounts” to verify volume “jenkins-v1” was created</figcaption></figure><h4><strong>Verify that Jenkins is running</strong></h4><p>Since I mapped the container to <strong>port 8080</strong>, copy the <strong>EC2’s IPv4 address</strong> and add <strong>:8080</strong> to the end in your web browser <strong>(http://&lt;IPv4&gt;:8080)</strong> to check if Jenkins’ default page appears. Make sure the EC2 security group has port 8080 open to allow access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xkoH3DsaE8h3HNw9Re6IJg.png" /><figcaption>default Jenkins page</figcaption></figure><p>Now we need to retrieve the Administrator password</p><h4>Retrieve the Jenkins password</h4><p>Jenkins generates an admin password the first time it starts, which is stored in the container.</p><p>To retrieve the password, we first need to <strong>bash into the container</strong> with the following command:</p><pre>docker exec -it jenkins /bin/bash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gdorLLUkSSVW3rNCuZzkKA.png" /></figure><p><strong>jenkins@c4b4dc84081a:/$</strong> confirms we are in bash of the container</p><p>After accessing the container’s bash shell, use the following command to retrieve the Jenkins admin password:</p><pre>cat /var/jenkins_home/secrets/initialAdminPassword</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-m-dX8QI8LaWtxTG5wq_VQ.png" /></figure><h4>Login and create a new user</h4><p>Go to the Jenkins default page as before. Take the generated admin password we found in bash and paste it into the administration password section to login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*hmoUmxwa5ypf6YucpEpiww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*azTfmhxgB16vLlo0NXdurQ.png" /></figure><p>Jenkins will now prompt you to create a new user. Fill in the information for your admin user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*t3tIfjuJUkT5UyRBsDX6OQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*UEN-76q1D73JEgiwGFPztw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*BpjXcrWFhPBorm9XQFve6Q.png" /></figure><p>Now select <strong>Start using Jenkins</strong> to access the Jenkins Dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FpqNvpEHzTG8YssJPTROdw.png" /></figure><h4>Launch a new Jenkins container using the same volume and verify that the data has persisted by logging in as the newly created user.</h4><p>Begin by stopping and removing the old container.</p><pre>docker stop jenkins<br><br>docker rm jenkins </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*6sBDKEPvehGdj1F4nNB6sw.png" /></figure><p>Create a new container and attach the previous volume we created to it</p><pre>docker run -d --name jenkins_newcontainer -p 8080:8080 -v jenkins-v1:/var/jenkins_home jenkins/jenkins:lts-jdk17</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*srOSyANXCL0AHy9OHRMcPQ.png" /></figure><p>Login back into the Jenkins dashboard. Notice when inputting the EC2 IPv4 address with :8080 it shows the login page now instead of the default configuration page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ckPdCk5t1Yl1PadvsRgSmg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sGH-mL1HolkOBXlA9QkYJQ.png" /></figure><p>This confirms we successfully logged in to the Jenkins dashboard with the new container.</p><h4>Docker Compose to run Jenkins</h4><p>Now I will do all the steps as before but in a more automated/streamlined process with a docker-compose YAML file.</p><p>To avoid confusion, I will delete the previous container and volume.</p><p>Begin by stopping the container and then deleting the container.</p><pre>docker stop jenkins_newcontainer<br><br>docker rm jenkins_newcontainer</pre><p>Remove the volume</p><pre>docker volume rm jenkins-v1</pre><p>Confirm removal</p><pre>docker ps <br><br>docker volume ls</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*3kyLNe1Z2OLyIFKZf0Ve3w.png" /></figure><p>Create a directory for the compose file</p><pre>mkdir jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*Q-wg4jnXu7_p-Or7kepYng.png" /></figure><p>Open the folder from the left panel in VS Code and select the directory you created. Then click OK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LXP3v04uQIb8QzmeoaN_7w.png" /></figure><p>Create a new file and name it <strong>docker-compose.yml</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*8PMWXWunF8PqckrL9BwTjQ.png" /></figure><p>Edit the compose file to start composing the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/1*1Ol-IAMnWp3tNFoKbNcYnw.png" /></figure><p>Save the file using <strong>:wq!</strong></p><p>Notice that the compose file is like the command we used earlier to “Create a new container and attach the volume”.</p><ul><li>docker run -d — <strong>name jenkins_newcontainer</strong> -p <strong>8080:8080</strong> -v <strong>jenkins-v1:/var/jenkins_home</strong> <strong>jenkins/jenkins:lts-jdk17</strong></li></ul><p>Execute the following command to run the compose file:</p><pre>docker compose up</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SotD4s_JSriFCLABMQDPVQ.png" /></figure><p>Scroll down to the generated admin password for jenkins</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*vR2I1vy71W8-pp7VSaXLnw.png" /></figure><p>As before, copy the EC2 IPv4 address with :8080 into the browser to see the Jenkins default page. Then input the generated admin password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9hgoh2TbUTmmnVOnhSKaKw.png" /></figure><p>Install suggested plugins and create a new Jenkins admin. Then go to the Jenkins dashboard. Notice the username says <strong>Docker Compose</strong> confirming that this is a new Jenkins dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IW0d21Cd1D8e9beONCoRWQ.png" /></figure><p>To remove the container run the following command in the terminal:</p><pre>docker compose down</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GpRvUcpFeK4U2oE3OUNCFA.png" /></figure><h4>Summary</h4><p>This project focused on setting up and managing Jenkins using Docker and Docker Compose. By using a Docker volume, Jenkins data was securely saved, making it easy to restart or update without losing important settings. This approach highlighted how containerization simplifies deployment, keeps data safe, and automates key workflows.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60aeb641c7ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker: Containerized Web Application Deployment]]></title>
            <link>https://medium.com/@labossiere01/docker-containerized-web-application-deployment-438727d314ce?source=rss-861abfa929ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/438727d314ce</guid>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[web-applications]]></category>
            <dc:creator><![CDATA[John Labossiere]]></dc:creator>
            <pubDate>Mon, 11 Nov 2024 06:10:56 GMT</pubDate>
            <atom:updated>2024-11-11T06:10:56.897Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*51yN3huQAqhiPx9P.jpg" /></figure><h4>Business Case:</h4><p>Level Up Solutions is a dynamic technology company offering its clients innovative web solutions. As part of their software development process, they have decided to adopt containerization using Docker to streamline their web application deployment. Docker provides Level Up Solutions with a flexible and efficient way to package, distribute, and run their applications in isolated containers, ensuring consistency and portability across different environments.</p><p>Level Up Solutions can harness the benefits of Docker containers, including consistency, portability, isolation, reproducibility, version control, scalability, streamlined deployment, and improved collaboration. These advantages contribute to more efficient and reliable web application deployments, enhancing the company&#39;s overall development and deployment processes.</p><h4><strong>Requirements:</strong></h4><p>1. Run a Docker Ubuntu container running detached and on port 80.</p><p>2. Using BASH shell update all packages within the container.</p><p>3. Using BASH install Apache2 on the Ubuntu container.</p><p>4. Add a custom webpage.</p><p>5. Verify you can reach the webserver from your browser.</p><h4>Prerequisites:</h4><ul><li>Deploy AWS EC2 Instance running on Ubuntu Server 24.04 LTS</li><li>EC2 Instance with a security Group that allows SSH and HTTP traffic from My IP address. Keypair to SSH.</li><li>Visual Studio Code with extensions — Docker, YAML, Remote Development, Remote-SSH, GitLens</li></ul><h3>Install Docker</h3><ol><li>SSH into the EC2 instance. Then run the following command to install Docker:</li></ol><pre>curl -fsSL https://get.docker.com -o get-docker.sh</pre><pre>sh get-docker.sh</pre><p>2. After the script finishes, verify the docker installation:</p><pre>docker version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*NOQZtAlo2C23HPDrzF1O5A.png" /></figure><p>3. Notice the message says “permission denied” because the user doesn’t have permission to access the docker daemon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9a2PQUgyyaGb6kdGMHlUuA.png" /></figure><pre>permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get &quot;http://%2Fvar%2Frun%2Fdocker.sock/v1.47/version&quot;: dial unix /var/run/docker.sock: connect: permission denied</pre><p>Run this command to resolve this:</p><pre>sudo chmod 666 /var/run/docker.sock</pre><h3>Connect EC2 instance to VS Code</h3><p>Now we’ll connect the EC2 instance to VS Code.</p><p><strong>Steps to connect</strong></p><ol><li>As mentioned in the prerequisites, download the <strong>Remote — SSH extension</strong> in VS code.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TqZXpTpKrAAaYLmPWoGlJw.png" /></figure><p>2. Click on the <strong>green &gt;&lt; symbol</strong> located at the bottom right of VS code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*NhiT10Xac_IJxjpIUTe3Eg.png" /></figure><p>3. In the menu that appears, select <strong>Connect to Host… Remote SSH</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*bFsKhJzkw_1ai7Mq3uydUg.png" /></figure><p>4. Select <strong>Configure SSH Host…</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*hXMluP8_vM29osgj0rVUPA.png" /></figure><p>5. Select the option that has <strong>.ssh</strong> folder in the path, which will show the config file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*thwKN3SgWf52kie74sYCew.png" /></figure><p>6. Open the config file and add the following host information for docker.</p><pre>#Docker EC2<br>Host Docker<br>    #IPV4 Address will change every time<br>    HostName 18.234.148.186<br>    User ubuntu<br>    IdentityFile C:\Users\JohnnyL\Desktop\docker_ec2.pem</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*qjFsoJmV1A0XJjmETnR9GA.png" /></figure><p><strong>Host Docker</strong> is the name of the host.</p><p><strong>HostName</strong> is the EC2 instance IPV4 Address.</p><ul><li>Keep in mind that you will need to update the IPV4 Address every time you stop and start your EC2 instance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*YAX2qd7gPctodjkEEORQuA.png" /></figure><p><strong>User</strong> is set to Ubuntu since I’m using an Ubuntu instance</p><p><strong>Identityfile</strong> is the location of the key pair PEM file</p><p>7. Click on the <strong>green &gt;&lt;</strong> symbol again and select <strong>Connect to Host…</strong> but this time click on the hostname (<strong>Docker</strong>) we just configured.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*yRDO_KDEr82qu6ZLLAeBdg.png" /></figure><p>8. A window will open asking the type of instance (Linux, Windows, MacOS). Select <strong>Linux</strong> since we are using Ubuntu.</p><p>9. The <strong>green &gt;&lt;</strong> symbol should now show you’re connected to the EC2 instance.</p><ul><li>&gt;&lt; SSH: Hostname</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*gYeZZkRE6Kd8aTZnh7RjMA.png" /></figure><p>10. Open a terminal in VS code. Verify you are connected to the EC2 by running the command <strong>whoami</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1UOGo6IM6-aU7Vn5HvksyQ.png" /></figure><h3>Run a Docker Ubuntu container running detached and on port 80</h3><ol><li>Begin by pulling the latest Ubuntu image from Docker Hub:</li></ol><pre>docker pull ubuntu</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*I_iLBLzRrlvBAg1htWOHsg.png" /></figure><p>2. Run the Docker container with the following command:</p><pre>docker container run -itd -p 80:80 ubuntu</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*rmLLsVXnw2T7zsJlBF2QOw.png" /></figure><ul><li><strong>-i: </strong>Keeps the container’s standard input (STDIN) open, meaning the container is ready to receive commands or input from you.</li><li><strong>-t</strong>: Allocates a pseudo-TTY (a terminal interface), allowing you to interact with the container. Giving you a normal command-line interface to work with, so you can see prompts and type commands as if you’re in a regular terminal window.</li><li><strong>-d</strong>: Runs the container in detached mode, meaning it runs in the background.</li><li>-<strong>p 80:80</strong>: Maps port 80 on the EC2 instance to port 80 in the container, making the web server accessible externally.</li></ul><p>3. Verify the container is running:</p><pre>docker ps</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*LEhbHumk1Nsno9eKD-I0Uw.png" /></figure><p><strong>Using BASH shell update all packages within the container</strong></p><ol><li>To access the BASH shell inside the container, run:</li></ol><pre>docker exec -it container name bash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*4cYR_ma5nma0nn1adbaUpw.png" /></figure><ul><li>Notice the root@container ID to verify we are in the bash shell</li></ul><p>2. Update and upgrade all packages:</p><pre>apt update &amp;&amp; apt upgrade -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*CKymp_2qdVkOFb6WxMe99w.png" /></figure><h3>Install Apache2 on the Ubuntu container</h3><ol><li>Use the following command to install Apache2:</li></ol><pre>apt install apache2 -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*4XxUnUjEyrgXh6gurgWs9g.png" /></figure><p>2. Start the Apache service and verify it’s running:</p><pre>service apache2 start</pre><pre>service apache2 status </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*tRaptAwTwoN-ymZg_7I5OA.png" /><figcaption>the apache status shows its running</figcaption></figure><p>3. Verify the Apache default webpage by entering the EC2 instance’s public IPv4 address in a browser. If the webpage doesn’t load, update the EC2 instance’s security group to allow HTTP traffic on port 80.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*ezJ_0jfbWA8ACZfPg8rGsg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sUOc7MMO4l4DD0seRO_4dw.png" /></figure><p>4. Run the <strong>service apache2 start </strong>and<strong> service apache2 status </strong>again. Then verify the default Apache2 webpage again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*1JSxmrV-TF2aE80ICyiukQ.png" /><figcaption>Apach2 Default Webpage</figcaption></figure><h3>Add a Custom Webpage</h3><p>Now we will customize the Apache default webpage.</p><ol><li>Go to the <strong>index.html</strong> file within <strong>/var/www/html</strong> in your container with the following commands:</li></ol><pre>cd /var/www/html</pre><pre>ls</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*3J-eVacyxPgULlRdbFWmIQ.png" /></figure><p>3. To edit the index.html file we will need to install a text editor like <strong>nano</strong> or <strong>vim</strong>. These text editors are not on this ubuntu container by default.</p><pre>apt install vim</pre><p>After installing vim, run the following command to access the index.html:</p><pre>vim index.html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*SDs8Njhgt0Q1u-J1RBFcyg.png" /></figure><p>4. Once in the index.html adjust by pressing <strong>-i</strong> to <strong>insert. </strong>I chose to delete the entire default HTML code and paste the custom HTML webpage code about traveling by running the following commands.</p><ul><li><strong>gg</strong> to move to the top line</li><li><strong>dG</strong> to delete all lines</li><li>then paste custom HTML webpage code</li><li><strong>:wq!</strong> to force save changes</li></ul><p>5. Now refresh your browser to see the custom webpage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hiiPwnwYinqLCvO5oRAEoA.png" /><figcaption>Custom Webpage</figcaption></figure><h3>Cleanup and Stopping EC2 Instance to Avoid Additional Charges</h3><p><strong>Warning:</strong> Be mindful of the following steps because they will stop the services and cause data loss if not backed up. Since I no longer need the custom webpage and to avoid incurring additional charges for keeping my EC2 instance running, I’ll follow these steps:</p><ul><li>Exit the container’s shell:</li></ul><pre>exit</pre><ul><li>Stop the docker container and remove it from the instance using the following commands:</li></ul><pre>docker stop &lt;container name&gt;</pre><pre>docker rm -f &lt;container name&gt;</pre><ul><li>Clean up unused Docker images, containers, volumes, and networks to free up space and ensure no unnecessary resources are left running.</li></ul><pre>docker system prune -a</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*7_FwaZeKoE2N6iS4z4Mhcw.png" /></figure><ul><li>Stop the EC2 instance to prevent any further charges for its usage.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*Q62nr9Oy6Sws_0Y1U0_9Bg.png" /></figure><h3>Summary</h3><p>In this project, we showed how to deploy a web application using Docker on an AWS instance. By containerizing the application, I ensured that the deployment process was consistent, portable, and isolated from the host system. Docker allowed us to efficiently install Apache, customize a webpage, and expose it on port 80. I also covered the necessary steps to clean up the environment to avoid any unnecessary charges from running the EC2 instance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=438727d314ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure AI Image Recognition & Sentiment Analysis]]></title>
            <link>https://medium.com/@labossiere01/azure-ai-image-recognition-sentiment-analysis-a69ead198375?source=rss-861abfa929ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/a69ead198375</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[image-recognition]]></category>
            <category><![CDATA[azure-ai-services]]></category>
            <category><![CDATA[sentiment-analysis]]></category>
            <dc:creator><![CDATA[John Labossiere]]></dc:creator>
            <pubDate>Mon, 28 Oct 2024 22:05:49 GMT</pubDate>
            <atom:updated>2024-10-28T22:09:17.134Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CovI_N1MNySkPhwS" /></figure><h4>Business Scenario:</h4><p>Level Up Llama Tech, a tech accessories company, faces challenges in efficiently managing customer feedback and product reviews. The company needs a solution to automatically analyze customer reviews, identify product images, and provide actionable insights to improve customer satisfaction and product quality.</p><h4>Business Solution:</h4><p>Implement an AI-powered system that leverages Azure AI services to analyze customer reviews and identify product images. The system will use image recognition to classify product images and sentiment analysis to gauge customer satisfaction levels. By integrating these insights into the company’s customer relationship management (CRM) system, Level Up Llama Tech can quickly respond to customer needs and enhance product offerings.</p><h4>Implementation Steps:</h4><ol><li>Set up Cognitive Services in Azure Portal</li><li>Store a Dataset of Customer Images and Reviews</li><li>Analyze Images with Computer Vision</li><li>Analyze Reviews with Text Analytics</li><li>Summarize the Findings</li></ol><h3>1. Set up Cognitive Services in Azure Portal</h3><h4><strong>Create Resource Group:</strong></h4><ul><li>Creating a <strong>Resource Group</strong> in Azure allows you to organize and manage all the resources related to your project in one place, like a folder.</li></ul><ol><li>Login to Azure Account. Then go to <strong>Resources groups</strong> to create a new group.</li><li>Configure the following settings:</li></ol><ul><li><strong>Subscription:</strong> Azure subscription</li><li><strong>Resource group:</strong> name your resource group</li><li><strong>Region:</strong> select the region</li></ul><p>3. Select <strong>Review + Create</strong> then click <strong>Create</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*QJ7ZJdKFbhsdYMAX7zPlHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*_M_N67nuUVOSUVGYP7AdcA.png" /></figure><h4><strong>Create a Computer Vision resource</strong></h4><ul><li>This tool processes and interprets images.</li></ul><ol><li>Select <strong>Create a resource</strong></li><li>Select <strong>AI + Machine Learning</strong></li><li>Find <strong>Computer Vision</strong> then select <strong>Create</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*e-PAKt-_YAjMZ-fIx3e6sQ.png" /></figure><p>4. Configure the <strong>Computer Vision</strong> settings and select <strong>Review + create</strong></p><ul><li><strong>Subscription:</strong> Select your subscription</li><li><strong>Resource group:</strong> Select the resource group created earlier</li><li><strong>Region:</strong> East US</li><li><strong>Name:</strong> create a name</li><li><strong>Pricing tier:</strong> I chose the free tier</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*5Gyfgpqbj7Fw4t1c2ETBDw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*Z15qADWtLB1eWgLEdZCnug.png" /></figure><h4><strong>Create a Text Analytics resource</strong></h4><ul><li>This tool processes text to analyze sentiment, keywords, and overall customer opinions in reviews.</li><li>Select <strong>Create Resource</strong> again in the Azure portal</li><li>Select <strong>AI + Machine Learning</strong></li><li>Find <strong>Language services</strong> then select <strong>Create</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*gFQ-Jk8UU2hDZ3KSOG3zoQ.png" /></figure><p>1. Configure the <strong>Text Analytics</strong> settings and <strong>Review + create</strong></p><ul><li>Begin by selecting <strong>Continue to create your resource</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*BcSVV_ONPu6kTPeQ1yyQTQ.png" /></figure><ul><li><strong>Subscription:</strong> Select your subscription</li><li><strong>Resource group:</strong> Select the A.I. resource group created earlier</li><li><strong>Region:</strong> East US</li><li><strong>Name:</strong> create a name</li><li><strong>Pricing tier:</strong> I chose the free tier</li><li><strong>Check the Responsible AI Notice Box</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*8JJn-1rAYcklPlGLyxZTsA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*tHNN0yvmPhlZ8zj9GMFBxA.png" /></figure><h3>2. Store a Dataset of Customer Images and Reviews</h3><h4>Create a Storage Account</h4><ul><li>This is where all project data will be stored securely in Azure.</li></ul><ol><li>Select <strong>Storage Accounts</strong> from the menu located on the left side</li><li>Select <strong>Create a Storage account</strong></li><li>Configure the <strong>Storage Account</strong> settings and select <strong>Review + create</strong></li></ol><ul><li><strong>Subscription:</strong> Select your subscription</li><li><strong>Resource group:</strong> Select the A.I. resource group created earlier</li><li><strong>Storage account name:</strong> Create a unique name</li><li><strong>Region: </strong>East</li><li><strong>Performance: </strong>I selected Standard</li><li><strong>Redundancy:</strong> I choose Locally-redundant storage (LRS)</li><li>Select <strong>Review + create</strong>, then select <strong>create</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FzgwN2v6BuYvfFO6WLH5LA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*JsphNnpchVPhiLvG6z32AQ.png" /></figure><h4>Create a Blob Container</h4><ul><li>This acts like a folder within the storage account specifically for storing customer images and reviews</li></ul><ol><li>Go to the <strong>Containers</strong> section of the Data storage</li><li>Select the <strong>+Containers</strong> button</li><li>Name the container</li><li>Leave the default <strong>Anonymous access level </strong>for Private</li><li>Select <strong>Create</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*ElFaoPnXL3mw85oUv9zj_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/1*yNZyjh65pJpYt0H4ylm2CQ.png" /></figure><h4>Upload sample images and reviews</h4><ul><li>Now upload the images and reviews to the container. This step places the data into the Blob container, making it accessible for analysis.</li></ul><ol><li>Select the <strong>container</strong> we just created</li><li>Select the <strong>Upload button</strong></li><li>Find the files you’d like to upload and load. Select the files and upload them to the container</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*M3E2csvp3nsNohM5ZmcFzA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*ndlUd98dZgunsOY9H8oMSg.png" /></figure><h3>3. Analyze Images with Computer Vision</h3><ul><li>Now we will analyze the uploaded image files using the Analyze Image API in the Azure Portal.</li></ul><ol><li>Go to the Computer Vision resource we created earlier</li><li>Select Go to Vision Studio</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*hNWsq1t4uH310FlHIYi1fw.png" /></figure><p>3. Select <strong>Try it out</strong> under the Detect common objects in the images section</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*uCBWQZtha8qMHgbk51Kw-g.png" /></figure><p>4. Press <strong>Please select a resource</strong>, then select the correct subscription and resources</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*kdmGG2NsPZxkZk4k7_uRrA.png" /></figure><p>5. Then check the box, to acknowledge the upload of the images</p><p>6. Select browse for a file and select your images</p><ul><li>The image below shows a laptop with a computer mouse score of 74.60% along with the JSON formatted information</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*UUpRR5hKIidQNZRF-P21Lw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*ODgYzomashNZGK5qOKq3vg.png" /></figure><ul><li>The next image analyzes a camera.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z_Nffnq7geelleCU5w6i0A.png" /></figure><h3>4. Analyze Reviews with Text Analytics</h3><ul><li>Now, we will use Language Studio to analyze our customer reviews and learn what people think of our products.</li></ul><ol><li>Go to the Text Analytics resource you created earlier. Then go to Language Studio.</li><li>Select <strong>Analyze Sentiment and mine opinions</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*SjogIKH9x6uU209kZ9t3eg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*r9JAyXZPXtxaINJQXj1fVA.png" /></figure><p>3. Sign in and select the following:</p><ul><li><strong>Azure directory</strong></li><li><strong>Azure subscription</strong></li><li><strong>Resource type</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*M9X37DW64q70fIl9_60I2g.png" /></figure><p>4. Now we will upload the text file of the customer reviews</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*zSO99Yz5oesGmcfqy0sY1A.png" /></figure><p>5. Select <strong>Run</strong> to see the results of the uploaded customer review file</p><ul><li>Below are the results of analyzing both positive and negative reviews</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*txGRMEx8_oDgT-uCe0YbGg.png" /></figure><ul><li>The analysis below shows that the sentiment was <strong>100.00% positive</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*XpTTibH_xiR7MtjkimrjLQ.png" /></figure><ul><li>The analysis below shows that the sentiment was 91<strong>.00% positive</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*NBiv4p5Lx95DHOcoQ2N-eA.png" /></figure><ul><li>Along with the JSON formatted sentiment</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*Q5aP0ND_3kVw8P8kxhbhWw.png" /></figure><h3>5. Summary</h3><p>The <strong>Analyze Image API</strong> identified a few of my images, including the laptop, and camera. Most of the images were detected correctly, and a couple of results were off.</p><p>The <strong>Analyze sentiment and mine options</strong> feature in Language Studio was impressive to see. Overall, the data showed that out of the reviews, <strong>48% were positive</strong>, <strong>4% neutral</strong>, and <strong>48% negative</strong>. I liked how the results showed each review&#39;s sentence sentiment. For example, <strong>“It’s a stylish accessory, but I wish it had more customizable options.”</strong> Sentence sentiment scored, <strong>69% positive</strong>, <strong>19 neutral</strong>, and <strong>11% negative</strong>.</p><p>This project gives Level Up Llama Tech helpful insights to boost customer satisfaction and improve products.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a69ead198375" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure and Scalable Management of Azure Virtual Machines]]></title>
            <link>https://medium.com/@labossiere01/secure-and-scalable-management-of-azure-virtual-machines-a4326a251377?source=rss-861abfa929ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4326a251377</guid>
            <category><![CDATA[azure-scale-set]]></category>
            <category><![CDATA[autoscaling]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ssh]]></category>
            <dc:creator><![CDATA[John Labossiere]]></dc:creator>
            <pubDate>Fri, 11 Oct 2024 16:08:05 GMT</pubDate>
            <atom:updated>2024-10-11T16:08:05.896Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*tKcKflZxro5LTqQR" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*RtsiZ9cV-h36R7Di2oKz_Q.png" /></figure><h4>Scenario</h4><p>Level Up Corporation hosts its Linux and Windows applications on over 100 Azure Virtual Machines (VMs). The globally dispersed IT team needs efficient, secure, and reliable tools for remote administration and troubleshooting to minimize downtime and security risks. Additionally, the company needs to ensure high availability and scalability of its applications.</p><h4>Solution</h4><p>By implementing Auto Scaling Groups, which automatically adjust the number of VMs based on demand, scalability is ensured. Additionally, incorporating SSH encryption helps minimize the risk of unauthorized access and data breaches, securing remote connections effectively.</p><h4>Benefits of the Solution</h4><ul><li><strong>Improved Productivity and Efficiency:</strong> Prompt issue resolution through direct VM access.</li><li><strong>Enhanced Security:</strong> Encrypted communication channels prevent unauthorized access and data breaches.</li><li><strong>Cost Savings:</strong> Reduced downtime and increased IT efficiency lower operational costs.</li><li><strong>Easy Administration and Troubleshooting:</strong> Simplifies server management, configuration, and troubleshooting.</li><li><strong>Scalability:</strong> Supports the management of an increasing number of VMs as the company grows.</li><li><strong>High Availability:</strong> Ensures application uptime through load balancing and auto-scaling.</li></ul><h4>Prerequisites:</h4><ol><li>Azure account</li><li>Understanding of Azure</li></ol><p><strong>Implementation Steps:</strong></p><ol><li><strong>Deploy a Linux Azure VM</strong> and configure it with a key pair.</li><li><strong>Create a Network Security Group (NSG)</strong> to allow SSH access.</li><li><strong>SSH into the deployed Linux Azure VM</strong> and run the “whoami” command to verify access.</li><li><strong>Set up an Auto Scaling Group</strong> for the VMs to automatically adjust the number of instances based on demand.</li></ol><h4>Deploy a Linux Azure VM and configure it with a key pair</h4><ol><li>In Azure, for <strong>Virtual machines</strong></li><li>Then click <strong>Create</strong> <strong>&gt;</strong> <strong>Azure virtual machine</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*Ry2aVp9uOBl9y4uCffXKWA.png" /></figure><p>3. Select your <strong>Subscription</strong> and either create or choose an existing Resource Group. In my case, I will create a new <strong>Resource group</strong>.</p><p>4. Name and configure the <strong>Instance details</strong></p><ul><li><strong>Vitural machince name</strong> = Linux-Azue-VM</li><li><strong>Region</strong> = (US) East US 2</li><li><strong>Availability options</strong> = No infrastructure redundancy required</li><li><strong>Security type</strong> = Standard</li><li><strong>Image</strong> = Ubuntu Server 24.04 LTS — x64 Gen2</li><li><strong>VM architecture</strong> = x64</li><li><strong>Size</strong> = Standard_B1s — 1 vcpu, 1 GiB memory</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*ynkylVNAZw1M5OJP7UyGiA.png" /></figure><p>5. Within the <strong>Administrator Account</strong>, apply these configurations</p><ul><li><strong>Authentication type</strong> = SSH public key</li><li><strong>Username</strong> = azureuser</li><li><strong>SSH public key source</strong> = generate new key pair</li><li><strong>SSH Key Type</strong> = RSA SSH Format</li><li><strong>Key pair name</strong> = Linux-Azure-VM_key</li></ul><p><strong>Inbound port rules</strong></p><ul><li><strong>Public inbound ports</strong> = Allow selected ports</li><li><strong>Select inbound ports</strong> = SSH (22)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*UbUTaXSkb55vTjq5iwMvcg.png" /></figure><p>6. Click on <strong>Review + create</strong> to create the VM. Download the private key for later SSH access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*ZtR8LCIf6iimPFjntlTqBQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*XSa1iXzf29Wj_6u3I9oG0A.png" /></figure><h4>Create a Network Security Group (NSG) to allow SSH access</h4><p>Since I already selected SSH (22) as an inbound port rule while creating the Linux VM and a default Network Security Group (NSG) was automatically created. I will confirm that the NSG is configured to allow SSH traffic in port 22.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*LmvLmdirV6ei4pUHMKSGFg.png" /><figcaption>From previous Linux VM deployment</figcaption></figure><ol><li>Search for <strong>Network Security Group</strong> in the Azure portal and click on it.</li><li>Click on the NSG (<strong>Azure Linux VM NSG)</strong> associated with your Linux VM.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*0rn9jobU1SxR96Vz-yvZEw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*el19Gc-Ddym8YyYqc6lF1A.png" /></figure><p>3. Click on the <strong>SSH</strong> icon next to the orange hazard sign. The SSH port configurations will appear.</p><p>4. Confirm that <strong>Port = 22</strong>, <strong>Protocol = TCP</strong>, <strong>Action = Allow,</strong> and the priority is the lowest among all your Inbound Security Rules. In my case, the priority is set to 300.</p><ul><li>This rule will allow secure access to the Azure-Linux-VM instance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zclsv5Sl0rxWyuxgtlzo0g.png" /></figure><h4>SSH into the deployed Linux Azure VM</h4><ol><li>Go back to the Azure Linux VM.</li><li>Before attempting to SSH into the Linux VM confirm the following:</li></ol><ul><li>Confirm the Linux VM’s Public IP address within the Network settings.</li><li>Confirm the Linux VM is running.</li></ul><p>3. Click <strong>Connect</strong> then click Native SSH for detailed SSH instructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*b2tMT3nUnPtcofASsqaCQQ.png" /></figure><p>4. Open a Windows PowerShell. and cd (change directory) into the directory where the SSH key is located.</p><pre>cd \Desktop\</pre><p>5. Within the Native SSH instructions, under step 3, <strong>“Copy and execute SSH command”</strong>, first replace the placeholder with the path where the SSH key is saved. Then, copy the updated SSH command and paste it into PowerShell to execute the command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*ZI3JYSBITT6eIgyXYbbBZA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*8cPHJ9J0LiLsEDHAKkU1yA.png" /></figure><p>6. Once in the Linux VM, run the<strong> </strong>“<strong>whoami</strong>” command to verify access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*NxsUyMHcyE-JUVDVSLBSpA.png" /></figure><h4>Set up an Auto Scaling Group</h4><ol><li>Search <strong>Virtual machine scale sets</strong> within the search bar.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*E9UT70PANnG3jHkMDpeJHQ.png" /></figure><p>2. Click on <strong>Create virtual machine scale sets</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*w0IKJSNYFMpYpoJ7CoMTOA.png" /></figure><p>3. Configure the scale set with the following settings:</p><ul><li><strong>Resource group:</strong> Create a new resource group for VM scale set</li><li><strong>Virtual machine scale set name:</strong> Name the scale set</li><li><strong>Region:</strong> (US) East US 2 or your preferred region</li><li><strong>Availability zone: </strong>None</li><li><strong>Orchestration mode:</strong> Flexible</li><li><strong>Security type:</strong> Standard</li><li><strong>Scaling mode:</strong> Autoscaling</li><li><strong>Image:</strong> Ubuntu Server 24.04 LTS — x64 Gen2</li><li><strong>VM architecture:</strong> x64</li><li><strong>Size:</strong> Standard_B1s — vcpu, 1 GiB memory</li><li><strong>Authentication type:</strong> SSH public key</li><li><strong>SSH Key Type:</strong> RSA SSH Format</li><li><strong>Key pair name:</strong> create a new key pair for the VM scale set</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*rXQLtFiwCmh-RQewwLj0Bw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*DYhSZ_pMNCYBLk8qf9B0uw.png" /></figure><p>4. Before clicking <strong>Review + create</strong>, select <strong>Configure</strong> within the Scaling configuration section, to update the scaling configurations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*yjEjYt8-tOxsdcY-eM2XpA.png" /></figure><p>5. Select <strong>Default condition</strong> to open the breakdown of the scaling. Update the configuration settings to the following and click save:</p><ul><li><strong>Initial instance count = 1</strong> (the number of VM’s deployed in this scale set)</li><li><strong>Instance limit — Minimum = 1</strong> (minimum count of instances to scale down to)</li></ul><p>Don’t change the rest of the default scaling configuration</p><ul><li><strong>Instance limit — Maximum = 20</strong> (maximum count of instances to scale up to)</li><li><strong>Scale out — CPU threshold greater than = 80</strong> (Every time the average CPU usage is greater than 80%)</li><li><strong>Scale out — Increase instance count by = 1</strong> (The condition will increase the instance count by 1 instances)</li><li><strong>Scale in — CPU threshold less than = 20</strong> (Every time the average CPU usage is less than 20%)</li><li><strong>Scale in — CPU threshold less than = 1</strong> (The condition will decrease the instance count by 1 instances)</li><li><strong>Query duration — Minutes = 10</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IL7J6LdylJ1zVYECPtbATw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y1D24hGFQMMNFl7kb6Mvvg.png" /></figure><p>6. Now select <strong>Review + create </strong>to complete the deployment. Make sure to download and save the private key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*Ukkg7ZWYRCzQB5FQ5NRjog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*IiJsV1OXNxQlhZULUIyLZQ.png" /></figure><p>7. After deployment, select <strong>Go to resources </strong>to confirm the scale set creation and check that <strong>Scaling = Autoscale</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*Fdo5bz3_0qaDjCVvPdSlTw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*9faz-ntMsHiRTuer-_FNyA.png" /></figure><h4>Summary</h4><p>This project highlights the secure deployment and scaling of Azure Virtual Machines for Level Up Corporation. By using auto-scaling groups, the company achieves high availability, scalability, and cost savings. Encrypted SSH communication ensures security and automated scaling reduces manual effort and operational costs. Overall, it was a valuable learning experience that demonstrated the capabilities of Azure’s cloud services.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4326a251377" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Lambda: Automatically Stop EC2 Instances]]></title>
            <link>https://medium.com/@labossiere01/aws-lambda-automatically-stop-ec2-instances-05d463ca6bc2?source=rss-861abfa929ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/05d463ca6bc2</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[ec2-instance]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[eventbridge]]></category>
            <category><![CDATA[boto3]]></category>
            <dc:creator><![CDATA[John Labossiere]]></dc:creator>
            <pubDate>Tue, 01 Oct 2024 15:49:18 GMT</pubDate>
            <atom:updated>2024-10-01T15:49:18.599Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/518/0*XPJQkUSKxvi2AYv2.png" /></figure><h4>Introduction/Scenario:</h4><p>Our DevOps engineering team often uses a development lab to test releases of our application. The Managers are complaining about the rising cost of our development lab and need to save money by stopping our (for this example) 3 ec2 instances after all engineers are clocked out.</p><h4>Solution:</h4><ol><li>Create a python script that stops all running EC2 instances.</li><li>Create a Lambda function using Python 3.8 or higher runtime to run your script.</li><li>Add a trigger to the Lambda to ensure it runs on a set schedule daily. No one should be working past 7pm. (Note: to test you may need to modify the time accordingly so you aren’t waiting for 7pm)</li></ol><h4>Prerequisites:</h4><ol><li>AWS account</li><li>Three EC2 instances running</li><li>Knowledge of Python</li><li>Knowledge of Boto3 <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/index.html">https://boto3.amazonaws.com/v1/documentation/api/latest/index.html</a></li></ol><h4><strong>What is AWS Lambda?</strong></h4><p>AWS Lambda is a serverless computing service that runs your code automatically in response to events, without the need to manage servers. You upload your code, and AWS handles the infrastructure and scaling, charging you only for the time your code runs, making it a cost-effective solution for on-demand tasks.</p><h4>Steps:</h4><ol><li>Create three EC2 instances and leave them running.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*67oKqEj4hWOm4wIq3qDLNA.png" /></figure><p>2. Navigate to the AWS Lambda dashboard and select <strong>Create a Function</strong>.</p><p>3. Choose <strong>Author from scratch</strong>.<strong> </strong>For runtime, select<strong> Python 3.9</strong> for and, <strong>arm64</strong> for architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*qAMiLZDKk6Ffv3oNNG5dVg.png" /></figure><p>4. To ensure the function’s code runs properly, update the Lambda function&#39;s permissions to allow <strong>AmazonEC2FullAccess</strong>. Without doing this you will receive an error message when deploying your code.</p><ul><li>Go to <strong>Configuration &gt; Permissions &gt; Role name of Lambda function</strong>. This will open a new tab in the IAM console.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*RPrJbHQEYa5YRdeoXTpm2A.png" /></figure><p>5. You’ll notice that the Lambda function IAM role already has a policy attached called <strong>AWSLambdaBasicExecutionRole</strong>. We still need to add the <strong><em>AmazonEC2FullAccess</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9IICFwmrNycCX-BezJrNOQ.png" /></figure><p>6. Click <strong>Add permission &gt; Attach policies</strong>, then search for <strong><em>AmazonEC2FullAccess</em></strong>. Select the policy and click <strong>Add permissions</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s3DkwA-1K2tiipPmP8sXqA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cbnc1qgLvuMqbjAAaRJB4Q.png" /></figure><p>6. Go back to the Lambda function code editor. Replace the default code with a python script that stops the three EC2 instances.</p><pre>import json<br>import boto3<br><br>region = &#39;us-east-1&#39;<br><br>instances = [&#39;i-0cce988c5514d873c&#39;, &#39;i-0df6d5624ed347bd0&#39;,&#39;i-09ac8c4d0ac090c16&#39;]<br><br>ec2 = boto3.client(&#39;ec2&#39;, region_name=region)<br>def lambda_handler(event, context):<br>    ec2.stop_instances(InstanceIds=instances)<br>    print(&#39;stopped your instances: &#39;+ str(instances))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*Rge-X9lgusqCp_iyS4gsAw.png" /></figure><p>7. Click ‘Test’ to ensure the function runs without errors, and then click Deploy. The function stop the EC2 instances, confirming that your code works successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XWFBNs_MRiGHvWv5hazhXA.png" /></figure><h4>Adding an AWS EventBridge Trigger</h4><p>After verifying the Lambda function works, the next step is to set up a daily trigger to stop the EC2 instances after 7:00 PM using AWS EventBridge.</p><h4>What is AWS EventBridge?</h4><p>AWS EventBridge enables event-driven automation by connecting different services within your system. It can trigger actions, such as running code or moving data, in response to specific events, like reaching a scheduled time.</p><h4>Steps:</h4><ol><li>Go to <strong>Amazon EventBridge</strong> and select <strong>Create a rule.</strong></li><li>Name your rule and select <strong>Schedule</strong> as the rule type. Then click on <strong>Continue to create rule</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*GGuB9Mn2GwW59Sg-qkdstA.png" /></figure><p>3. Define the schedule for the cron expression. Since I’m located in Eastern Daylight Time EDT, the expression will be: <strong>0 23 * * ? * </strong>(this is for 7:00 PM EST)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*oikhD5d5wsCzkYw5RNtQjQ.png" /></figure><p>4. For the target type, select <strong>AWS Service</strong> and choose Lambda function. Then, select the <strong>Lambda function</strong> you created earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*BKYwLs3FUhIEE-wlcuXX_Q.png" /></figure><p>5. Review and confirm the rule details and click <strong>Create rule</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BUIjZOZwkF-jeLfURUSspw.png" /></figure><p>6. Refresh the Lambda function page. You’ll see the <strong>EventBridge (CloudWatch Events)</strong> listed as a trigger for the Lambda function.</p><ul><li>The function is now set to stop the EC2 instances at 7:00 PM everyday.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MB_qtn4sDFg2BTR2Icxjhw.png" /></figure><p>6. The below snapshot from the EC2 dashboard shows that the instances stopped running confirming that the trigger worked. You can also check the CloudWatch logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*oPnNTGB7krDNKzxTqkHmCQ.png" /></figure><h4>Github link</h4><p>Here is the link for my GitHub code <a href="https://github.com/john-laboss19/Lambda-Stop-EC2-Instances/tree/main">https://github.com/john-laboss19/Lambda-Stop-EC2-Instances/tree/main</a></p><h4><strong>Summary</strong></h4><p>This project shows how to automate stopping EC2 instances using AWS Lambda and EventBridge to cut costs by shutting them down after work hours. It was a great learning experience in using serverless tools to streamline tasks and reduce expenses in a development environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05d463ca6bc2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Extraction with Python & VS Code]]></title>
            <link>https://medium.com/@labossiere01/data-extraction-with-python-vs-code-74ff4867a48e?source=rss-861abfa929ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/74ff4867a48e</guid>
            <category><![CDATA[data-extraction]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[John Labossiere]]></dc:creator>
            <pubDate>Tue, 10 Sep 2024 12:27:09 GMT</pubDate>
            <atom:updated>2024-09-10T12:27:09.777Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U4hrW-fadBss4Dq6" /></figure><p><strong>Scenario:</strong></p><p>Your company needs to learn about the files located on various machines. You have been asked to build a script that extracts information such as the name and size of the files in the current working directory and stores it in a list of dictionaries</p><p><strong>Solution:</strong></p><p>Create a script that generates a list of dictionaries about files in the working directory. Then print the list.</p><p><strong>Prerequisites:</strong></p><ul><li>VS Code</li><li>Python installed</li><li>GitHub account</li></ul><h4>Script</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*4I2EiQuwuXp61qpx-j7bVA.png" /></figure><pre><br># Importing the os module<br>import os<br><br># Get the current directory path<br>current_dir = os.getcwd()<br><br># List all items (files and directories) in the current directory<br>all_items = os.listdir(current_dir)<br><br># Start an empty list to store information about files<br>file_info_list = []<br><br># Loop through the items in the current directory<br>for item in all_items:<br>    # Get full path for each item<br>    full_path = os.path.join(current_dir, item)<br><br>    # Check if the item is a file (not a directory)<br>    if os.path.isfile(full_path):<br>        # Create a dictionary with the file&#39;s path and size<br>        file_info = {<br>            &#39;file_path&#39;: full_path,<br>            &#39;file_size&#39;: os.path.getsize(full_path)<br>        }<br><br>        # Add file info to the list<br>        file_info_list.append(file_info)<br><br># Print each file&#39;s info<br>for info in file_info_list:<br>    print(info)</pre><h4>Push code to Github</h4><p>Now push the code from VS Code to Github. It took some troubleshooting to figure out how to complete this step, but I was glad to figure it out using the terminal commands below.</p><pre># Initialie a New Git Repository<br>git init<br><br># Add File <br>git add Data-Extraction.py or (file name)<br><br># Commit Changes<br>git commit -m &quot;initial commit, adding Data-Extraction.py&quot;<br><br># Check the Current Branch. Which was main.<br>git branch <br><br># Add a Remote Repository<br>git remote add origin https://github.com/john-laboss19/Data-Extraction.py.git<br><br># Push Your Changes to Github<br>git push -u origin main</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*N6RQJMigMxmwdDrnqNnzyQ.png" /></figure><h4>Github Repository:</h4><p>You can view my script <strong>Data-Extraction.py</strong> using the Github link below.</p><p><a href="https://github.com/john-laboss19/Data-Extraction.py"><strong>https://github.com/john-laboss19/Data-Extraction.py</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74ff4867a48e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD Using AWS CodePipeline and GitHub]]></title>
            <link>https://medium.com/@labossiere01/ci-cd-using-aws-codepipeline-and-github-f02d259cc1e1?source=rss-861abfa929ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/f02d259cc1e1</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[s3-bucket]]></category>
            <category><![CDATA[aws-codepipeline]]></category>
            <dc:creator><![CDATA[John Labossiere]]></dc:creator>
            <pubDate>Mon, 02 Sep 2024 00:38:46 GMT</pubDate>
            <atom:updated>2024-09-02T01:00:38.047Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*O2CqwE9CE2AFCPlY.png" /></figure><p><strong>Scenario/Business Case:</strong></p><p>The manual process for deploying website updates is slow and error-prone. The team needs an automated solution to speed up deployment and reduce mistakes. A CI/CD pipeline will streamline the building, testing, and releasing stages, making the process faster and more reliable.</p><p><strong>Prerequisites</strong></p><ul><li>GitHub account</li><li>AWS account</li><li>Basic understanding of HTML, S3, and CI/CD concepts</li></ul><p><strong>What is AWS CodePipeline:</strong></p><p>AWS CodePipeline is a CI/CD service that automates the build, test, and deployment stages. CI (Continuous Integration) means regularly merging code changes, while CD (Continuous Delivery) automates delivering updates. CodePipeline helps you quickly and reliably move code from development to production.</p><p><strong>What is Github:</strong></p><p>Github is a cloud-based platform for version control and collaboration that allows developers to manage and store their code in repositories. It helps teams work together by allowing multiple developers to work on the same project, track changes, and integrate code easily.</p><h4>1. Create new repository in Github or CodeCommit and load the attached HTML</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*INQmGUim2JT_IFpqHAoU_A.png" /></figure><h4><strong>2. Add a Branch Protection Rule</strong></h4><ul><li>Branch protection in Github helps prevent unwanted changes to important branches by enforcing specific requirements, such as:</li><li>Require a pull request before merging</li><li>Require approvals</li><li>Dismiss stale pull request approvals when new commits are pushed</li><li>Require review from Code Owners</li><li>Require approval of the most recent reviewable push</li><li>Require status checks to pass before merging</li><li>Require branches to be up to date before merging</li><li>Require conversation resolution before merging</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y_IIaeTBVeZHlGxJQtBUpA.png" /></figure><h4><strong>3. Create and configure a S3 bucket to host your static website</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*4v1tm9bghcxI-YBkF5lEsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*MDVPis55onHMgTCKPqCJtQ.png" /></figure><h4>CICD using the AWS Codepipeline service</h4><ol><li>Within AWS dashboard navigate to CodePipeline</li><li>Create a CodePipeline with the following settings: “<strong>Superseded</strong>”, “<strong>New service role</strong>”, leave the default selections for the remaining sections then select “<strong>next</strong>”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*DdzlrIEqVRsGm8MFPiEYng.png" /></figure><p>3. Add source provider and choose Github (Version 2).</p><ul><li>Since it&#39;s my first time connecting to GitHub, select “Connect to Github”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*PdleJwlJWkcoNoCyhQ9Itw.png" /></figure><ul><li>You will prompted to create a connection. Connect to your Github account and select “<strong>Install a new app</strong>” for the next step. This makes it easier to select your repositories and branches from Github.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*mBAuEuP-KbQ7ZyiXfzVqDw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*V2v5PeSMYuFP9lRS1wLv1A.png" /></figure><ul><li>Choose the repository you created earlier, set ‘<strong>main</strong>’ as the default branch, and use CodePipeline defaults.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*z3xWQyMPgC42F7qqj0ptLQ.png" /></figure><p>4. Skip the Build Stage and go to the Deploy stage</p><p>5. Choose the S3 bucket created earlier. Select “<strong>Extract file before deploy</strong>” and confirm the correct region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*d9PUKBKRDAFgve_qCDGGIA.png" /></figure><p>6. Review your pipeline and select <strong>create pipeline</strong>. You should now see the successful deployment of your pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sR3BploimxfTNOAV4YP10w.png" /></figure><p>7. Verify that <strong>website.html</strong> and <strong>README.md</strong> files were automatically moved from the GitHub repository to the S3 bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*wYpaAtrEQ8OOgMhoNAUsEA.png" /></figure><p>8. Verify access to Static website</p><ul><li>Select the <strong>website.html</strong> object in the S3 bucket.</li><li>Copy the URL and paste it into a web browser to ensure the website is working properly.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*Bje5a1d_slmFnfJjJatFMQ.png" /></figure><h4>Modify Code in GitHub to Trigger CodePipeline Updates</h4><ul><li>Let&#39;s add to the Github code to verify that the pipeline triggers updates when changes are made to the repository.</li><li>Go to the <strong>website.html</strong> file in Github then select the edit icon.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aMd9Nj13XDLxIG566V6CPA.png" /></figure><ul><li>I’m going to add “Think Positive” to the code and then select <strong>Commit changes</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ivDMDy0q5IaOzYAe0C6-ag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*dZyEQL8oxK-blvVCH6uiLw.png" /></figure><ul><li>The pipeline shows it was successfully deployed four minutes ago. Refresh your web browser to see the updated website.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*5lecFfLB5_x5M4PkGYmurQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*U4H6yd3oi_lp_gMJ9d1PPw.png" /></figure><h4>Summary</h4><p>This project demonstrates the implementation of a CI/CD pipeline using AWS CodePipeline to automate the deployment of a static website. By creating a Github repository, configuring an S3 bucket for hosting, and setting up a CodePipeline, the deployment process is streamlined, ensuring that updates to the website are automatically tested and deployed. This solution not only increases operational efficiency but also minimizes the risk of errors associated with manual deployments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f02d259cc1e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS DynamoDB]]></title>
            <link>https://medium.com/@labossiere01/aws-dynamodb-7aa2143189a3?source=rss-861abfa929ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/7aa2143189a3</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[data-management]]></category>
            <category><![CDATA[dynamodb]]></category>
            <category><![CDATA[secure-access]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[John Labossiere]]></dc:creator>
            <pubDate>Thu, 22 Aug 2024 11:31:17 GMT</pubDate>
            <atom:updated>2024-08-22T11:31:17.178Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*jgeS5Cb93Ik6zMth" /></figure><p>DynamoDB is a fully managed NoSQL database service provided by AWS. It allows you to store and retrieve large amounts of data quickly and efficiently. Unlike traditional databases, DynamoDB doesn’t require you to set up or manage any servers. It automatically handles the infrastructure, scaling, and security, so you can focus on using the data for your application.</p><p><strong>Business Case/Introduction:</strong></p><p>Let’s Go! Media Inc. is a media production and distribution company that creates and distributes movies, TV shows, and other entertainment content to consumers worldwide. As part of their business operations, they need to manage and track information about their media content, including metadata, ratings, and other relevant details.</p><p><strong>Solution:</strong></p><p>The company created a DynamoDB table to store details about the latest movie releases. To secure and control access, they used a t2.micro EC2 instance with an IAM role that grants only the minimum necessary permissions to read the table. This setup allows authorized users to safely access and analyze the data using the AWS CLI, helping the company make informed decisions about future content.</p><p><strong>Implementation Steps Overview:</strong></p><ol><li>Create a DynamoDB table for the latest Movie releases</li><li>Add 10 latest movie releases to the table, including the title, genre, release date, and rating.</li><li>Create a t.2micro Ec2 instance</li><li>Using an IAM role and the principle of least privilege, grant the EC2 instance read access to DynamoDB.</li><li>Use the AWS CLI in the EC2 instance to scan the DynamoDB table</li><li>Use the AWS CLI in the EC2 instance to validate you cannot write an item to the DynamoDB table</li></ol><h4>1. Creating DynamoDB table for the latest movie releases</h4><ul><li>Go to the DynamoDB and click “Create a table”</li><li>I name my table <strong>‘box office movies 202</strong>4’</li><li>Name the Partition Key and finalize the table set up</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*ZSZPiyXIof4UvudBUD9Oaw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ECBUKUUhvsEnF7qaGT1MGw.png" /></figure><ul><li>Add the top ten grossing movies of 2024 to the table, by creating ‘items’ that include the title, genre, gross, rating, and release date.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_NiK4bpGxADM3VscxZ08JA.png" /></figure><h4>2. Create a t.2micro Ec2 Instance</h4><ul><li>Launch an instance in the same region as the DynamoDB table</li><li>Name the EC2</li><li>AMI = Amazon Linux</li><li>Instance type = t2.micro</li><li>Security group = Allow SSH traffic</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HEb8_EWw5wIVmxb9F_R4Hw.png" /></figure><h4>3. Create IAM role</h4><ul><li>Create an IAM role for ‘least privileges’ for read access for DynamoDB</li><li>Navigate to IAM dashboard then select ‘<strong>Roles</strong>’</li><li>Select <strong>Create role</strong></li><li>Select <strong>AWS service</strong> for Trusted entity type and <strong>EC2</strong> for Use case</li><li>Add permission policy <strong>AmazonDynamoDBReadOnlyAccess</strong></li><li>Name and finalize the role creation</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XtX5JfM_V37hSucKvvo_Aw.png" /></figure><h4>4. Attach IAM role to EC2</h4><ul><li>Go back to the EC2 instance</li><li>Select ‘<strong>Action</strong>’ then ‘<strong>Security</strong>’ then ‘<strong>Modify IAM Role</strong>’</li><li>Choose the DynamoDB role you created then select <strong>Update IAM role</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xy_rWCP6YY5Ee1zmP1zmBw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*PRXtU9wCC1MDMBs2Qs6QYw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*d5BB3DblIn8XaWbs1GYGVA.png" /></figure><p><strong>5. Use the AWS CLI in the EC2 instance to scan the DynamoDB table</strong></p><ul><li>SSH into the EC2 instance using your key pair</li><li>Once in the EC2, input the following command to scan the table</li></ul><pre>aws dynamodb scan --table-name box_office_movies_2024 --region us-east-1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*zlcxjl1K4KzXJJcjkfsnvw.png" /></figure><p><strong>6. Validate you cannot write an item to the DynamoDB table</strong></p><ul><li>Try adding an item to the table from the EC2 instance to confirm that the IAM role successfully blocks write access</li></ul><pre>aws dynamodb put-item --table-name box_office_movies_2024 --item &#39;{&quot;movie_title&quot;: {&quot;S&quot;: &quot;The_Matrix&quot;}}&#39; --region us-east-1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TlVg5u1AxTa8zXWAajZsZQ.png" /></figure><ul><li>The error message confirms that the IAM role is working correctly, preventing any write attempts to the DynamoDB table.</li></ul><h4>Summary:</h4><p>I set up a DynamoDB table to track and manage the latest movie releases, helping Let’s Go! Media Inc. organizes and analyzes its media content. By configuring secure access through an EC2 instance and IAM roles, I ensured that data was protected and only accessible to authorized users.</p><p><strong>What I Learned:</strong></p><ul><li>How to create and manage DynamoDB tables for scalable data storage.</li><li>The importance of using IAM roles for secure, read-only access to data.</li><li>Interacting with DynamoDB and testing access controls.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7aa2143189a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Two-Tier Architecture in AWS]]></title>
            <link>https://medium.com/@labossiere01/two-tier-architecture-in-aws-82966e26929f?source=rss-861abfa929ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/82966e26929f</guid>
            <category><![CDATA[two-tier-architecture]]></category>
            <category><![CDATA[aws-architecture]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[amazon-rds]]></category>
            <category><![CDATA[ec2-instance]]></category>
            <dc:creator><![CDATA[John Labossiere]]></dc:creator>
            <pubDate>Sun, 18 Aug 2024 23:39:32 GMT</pubDate>
            <atom:updated>2024-08-18T23:39:32.928Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*HLo4DPIkM-fFjK9LfBFIww.png" /><figcaption>Two-Tier Architecture</figcaption></figure><h4>Introduction/Business Case:</h4><p>Adventure Works is a travel agency specializing in global adventure tours. To improve customer engagement and streamline operations, they are launching a new website using Joomla as their content management system (CMS). The goal is to create a scalable, secure, and reliable site that will support their growing business and serve as the main platform for all their travel services.</p><h4>Two-Tier Architecture:</h4><p>A two-tier architecture separates the application into two layers: the web server and the database server. This setup improves scalability, security, and ease of management.</p><ul><li><strong>Web Tier:</strong> The web tier consists of an EC2 instance running Apache and Joomla. It handles user interactions and serves web pages.</li><li><strong>Database Tier:</strong> The database tier uses an RDS instance with MySQL to store and manage application data securely.</li></ul><h3>Setting up Network</h3><h4>1. Create a Virtual Cloud Network (VPC)</h4><ul><li>Go to the VPC dashboard and select “Create VPC” the in US-East-1 region</li><li>Choose “VPC only” for manual setup</li><li>Use the CIDR block ‘<strong>10.0.0.0/16</strong>’ for IPv4</li><li>Name the VPC and complete the setup</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*10w6eOUPMQBN_cv8djXG1A.png" /></figure><h4>2. Create Subnets</h4><ul><li>Create four subnets with the VPC: two public and two private</li><li><strong>Public Subnet 1:</strong> AZ <strong>us-east-1a</strong>, CIDR block <strong>10.0.1.0/24</strong></li><li><strong>Public Subnet 2:</strong> AZ <strong>us-east-1b,</strong> CIDR block <strong>10.0.2.0/24</strong></li><li><strong>Private Subnet 1:</strong> AZ <strong>us-east-1a, </strong>CIDR block <strong>10.0.3.0/24</strong></li><li><strong>Private Subnet 2:</strong> AZ <strong>us-east-1b,</strong> CIDR block <strong>10.0.4.0/24</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*KhA9nGvD_0rsSF9CvCdW1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*pOVVI34aTyARFS8fJ8bk3Q.png" /><figcaption>Public and Private Subnets</figcaption></figure><h4>3. Internet Gateway and Route tables</h4><ul><li>We need to allow internet traffic, so we’ll create an Internet Gateway (IGW)</li><li>Create an IGW and attach it to the VPC</li><li>Associate the IGW with a route table linked to the public subnets.</li><li>Enable auto-assign Public IPv4 address</li><li>Create two private route tables and associate them with the private subnets</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZtXcwotpV7j_KVpZqZC6yw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*b-qrdz7k71VX42loGJzbFg.png" /></figure><h4>4. NAT gateway and Route table</h4><ul><li>Create a NAT gateway in the public subnet to give the RDS in the private subnet safe internet access</li><li>This setup protects the RDS from inbound internet traffic while allowing it to access updates and other resources.</li></ul><p>When creating the NAT Gateway:</p><ul><li>Choose the public subnet in Availability Zone 1 (AZ1)</li><li>Set the connectivity type to Public</li><li>Select Allocate Elastic IP</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*IE1Zo4esuf70mR_xGNEdvg.png" /></figure><ul><li>Create a second NAT gateway and choose public subnet AZ2</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*7ppgSht0VLMzIBdIwbBZtg.png" /></figure><ul><li>Associate Private-Route-table-1 with NAT-GW-1</li><li>Associate Private-Route-table-2 with NAT-GW-2</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*3LfVXVi5M2n61rROQrZQbQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g-VZyAv0vUaZ9fMTv6Ydow.png" /></figure><h3>Set Up Web Tier</h3><h4>1. Create an EC2 Instance</h4><ul><li>Create an Ubuntu EC2 instance in the public subnet</li><li>Assign the correct VPC and Public Subnet</li><li>Create a key pair for SSH access</li><li>Create an SSH key pair and set up a security group to allow SSH and HTTP access</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*w5I7QlQKrf5Xwh4f4NSjHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*AKnByHgXGiRbppJodzehhQ.png" /></figure><h3>Set up Data Base Tier</h3><h4>1. Create an RDS Subnet Group</h4><ul><li>Before creating the database, set up a subnet group for the private subnets.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*DI95ytkt1wR1wTxl6GCvuA.png" /></figure><h4>2. Launch a MySQL RDS Instance</h4><ul><li>Go to the RDS and select “Create Database”</li><li>Select MySQL Free Tier and name the database</li><li>Connect the database to the EC2 instance, which will automatically assign the VPC and RDS subnet group</li><li>Create a new security group for the RDS</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*zZJiC9W03yxoFy0csxk4MQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*49Ob6Txi781Cuk_vGSbw_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SQUnOb1PRXiih3V2y5zIVg.png" /></figure><h4>3. Install Joomla on EC2</h4><ul><li>launch EC2. Install Apache and Joomla</li><li>Set up login credentials and configure the Joomla with the RDS database</li><li>Input the RDS database name and endpoint</li><li>Access the Joomla website through the EC2 public IP and login to see the setup</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*Xz1026D-cZqgT7lieoCQ-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*_5cWPAUaDnvX8e5PaUwCTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*SroSxsuVvGzbDfrHR8vy7g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*GLO87oGzPOOWfYubH-myCA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*Utc5ZWRcGdnoUnljRoqrDA.png" /></figure><h4>Summary</h4><p>Successfully created a two-tier architecture to ensure scalability, security, and efficient operation for the Adventure Works website.</p><ul><li>Created a Virtual Private Cloud (VPC) with public and private subnets for network organization</li><li>Configured an Internet Gateway and NAT Gateway for secure internet access</li><li>Deployed an Ubuntu EC2 instance in the public subnet to host the web server</li><li>Set up a MySQL RDS instance in the private subnet for database management</li><li>Installed Joomla on the EC2 instance, linking it with the RDS database</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82966e26929f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>