<?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 Cristen Mack on Medium]]></title>
        <description><![CDATA[Stories by Cristen Mack on Medium]]></description>
        <link>https://medium.com/@cristendmack?source=rss-75dd8a1bb4c3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9zcwwI1mEdAqf47lc8H86w.jpeg</url>
            <title>Stories by Cristen Mack on Medium</title>
            <link>https://medium.com/@cristendmack?source=rss-75dd8a1bb4c3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 21:35:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cristendmack/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[Setting up an AWS Network Infrastructure]]></title>
            <link>https://medium.com/@cristendmack/setting-up-an-aws-network-infrastructure-2f370897bcc7?source=rss-75dd8a1bb4c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f370897bcc7</guid>
            <category><![CDATA[aws-security-group]]></category>
            <category><![CDATA[vpc]]></category>
            <category><![CDATA[woman-in-tech]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Cristen Mack]]></dc:creator>
            <pubDate>Thu, 09 Jan 2025 19:57:48 GMT</pubDate>
            <atom:updated>2025-01-09T20:08:14.853Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o-5wwsxNJmeaMff_tEwliA.png" /></figure><p>What is the backbone of AWS networking. It is the VPC! What is VPC? It stands for <strong>Virtual Private Cloud (VPC)</strong>, which is a isolated virtual private network dedicated to your very own AWS account in the cloud. Here you can deploy and manage your AWS resources securely.</p><h4>Use Cases:</h4><ul><li><strong>Hosting web applications</strong>: Deploying front-end servers in public subnets and databases in private subnets.</li><li><strong>Hybrid cloud environments</strong>: Extending on-premises network to AWS</li><li><strong>Secure data storage</strong>: Isolating sensitive workloads and control access using security features.</li></ul><h4>Let’s break down VPC further. Here are some components of VPC.</h4><p><strong>Subnet</strong>: allows for partitions of our network inside our VPC. Subnets can be public or private. Public allows accessibility from the internet and Private does not allow accessibility from the internet.</p><p><strong>Internet Gateway</strong>: horizontally scaled, highly available VPC component which allows instances within out VPC to connect to the internet and for the internet to start connections with instances within the VPC.</p><p><strong>Route Table</strong>: set of rules that determine where network traffic is directed. Key rule: every subnet in the VPC must be associated with a route table.</p><p><strong>Autoscaling Group</strong>: The goal of autoscaling is to scale in or scale out to match an increase or decrease in the workload. Also, helps replace unhealthy instances and helps minimize costs by adjusting to used resources</p><p><strong>Elastic Load Balancer</strong>: managed load balancer which captures the logs and stores them in the S3 bucket, allowing to direct traffic across multiple targets.</p><p><strong>NAT Instance</strong>: allows EC2 instance in private subnets to connect to the internet</p><p><strong>NAT gateway</strong>: managed by AWS which allows higher availability and higher bandwidth with no administration required</p><p><strong>NACL</strong>: firewall that controls traffice from and to subnet. NACLs have ALLOW and DENY (inbound/outbound) rules. There is generally only one NACL per subnet.</p><p><strong>Security Groups</strong>: firewall that controls traffice to and from an EC2 instance. It can only have ALLOW (inbound) rules.</p><p><strong>VPC Peering</strong>: connects two VPCs privately using the AWS network</p><p><strong>CIDR</strong>: Classless Inter-Domain Routing, which is an IP address allocation method improving data routing efficiency on the internet.</p><p>Now that we are more familiar with some VPC components, let’s create a VPC.</p><p>We will use these following steps to create a secured VPC.</p><ol><li>Create a VPC with CIDR 10.10.0.0/16.</li><li>Create three public subnets with 10.10.1.0/24 &amp; 10.10.2.0/24 &amp; 10.10.3.0/24.</li><li>Create an autoscaling group using t2. micro instances. The instances should have Apache installed on each instance with a custom web page.</li><li>Create an Application Load Balancer to distribute traffic to the autoscaling group.</li><li>Create web server security group that allows inbound traffic from HTTP from your Application Load Balancer. As a security precaution, no one should be able to use the public IP of your webserver to reach your website. All users should be using the Application Load Balancer.</li><li>Create a load balancer security group that allows inbound traffic from HTTP from 0.0.0.0/0.</li><li>Use the DNS URL of the Application Load Balancer in a browser to verify you can reach your site.</li></ol><h4><strong>Creating a VPC</strong></h4><ol><li>Once logged into AWS account, navigate to the VPC tab.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*_ICcbPk0o6pL6BReTe_3LQ.png" /></figure><p>2. After selecting, then click on select VPC only and give it a custom VPC name. Here we will use the create the VPC with CIDR 10.10.0.0/16.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PaZOP1xDNKDDGWemvkskGw.png" /></figure><p>3. Now that we have the VPC created, let’s edit the VPC settings to enable the DNS hostname. After selecting click save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*LlI8rH1CR2EdlOL2QamMwg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*VIItECj4qFcfhVUo5hh3vg.png" /></figure><h4>Creating Subnets</h4><ol><li>Select Subnets on the left side of the console then navigate to create subnet.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*pupcMC0dE7_I9OHFCPsYKg.png" /></figure><p>2. We will need to create each subnet separately and select the VPC that you want to attach the assigned subnet to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jvjwk3lHyFoNX3IS-WQqmg.png" /></figure><p>3. Now we’re ready to auto assign IP address to each subnet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7SE5nozDWcthVrhrCRSNbw.png" /></figure><h4><strong>Creating Route Table &amp; Internet Gateway</strong></h4><ol><li>Now let’s navigate to the route table on the console, and select route table to create a table which will direct our network traffic. It’s important here to make sure you route to the right VPC.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GcHeEHe0NExyHSxvZ9DjPw.png" /></figure><p>2. Let’s be sure to associate our subnets with our newly created route table. Once associated make sure the assigned subnets display as explicit subnet associations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*ZSMZq-z0tN3dWMtKTFhC3g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*az9aBU_G7SEQSlQOMEn2Gw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eUN9n1nsWut0zHQ4el9GaA.png" /></figure><p>3. Now let’s create the Internet Gateway for this VPC, to allow the connection to the internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mU83HZI7J9UJdXMFYNwQMg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*DMy7FWfqVl1Q-pMjvHJS5A.png" /></figure><h4>Creating Security Group for Load Balancer</h4><ol><li>Once selecting our security group on the load balancer, we will want to make it designated to allow http traffic.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/238/1*UgPeKbdRsARiL5904v8Asw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QRFiXCLZ8ZVaX41SMPhHBA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a2Ji9fLdY6cAv18tI1U1Vg.png" /></figure><h4>Setting Up Launch Template</h4><p>Launch template makes it easier for scalability and fault tolerance for the instances designated for multiple availability zones.</p><ol><li>Now let’s select launch template which will be find under EC2 , and create our new launch template. Then create the security group for the instance, which in this case we will want to choose the t2.micro for the instance type.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pKdbarWFLJlEXBgpxIhdWQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6nn6_rEi0QIwXJ7IgmIcOw.png" /></figure><p>2. Edit inbound rules to allow HTTP traffic from the Load balancer security group and Enable Auto-assign public IP so it is accessible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T4uxM-JUd1gDG4lSfE0RdA.png" /></figure><p>3. Now let’s scroll down to the Advanced details section. This user data will help install Apache requirements, which will able updates and specifies an html page configure to where each instance is in the availability zone.</p><pre>#!/bin/bash<br>yum update -y<br>yum install -y httpd<br>systemctl start httpd<br>systemctl enable httpd</pre><h4>Creating Autoscaling Groups</h4><ol><li>After creating the launch template, we’re ready to create our autoscaling group.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_d3y1GM1aeuG9n0C5TQNpQ.png" /></figure><p>2. Click next for network and select your VPC and associated subnets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZQ56CBAZe7_xeVineEJ7Xg.png" /></figure><p>3. Now, let’s skip to configure the group minimum capacity to 2 and maximum capacity to 5.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pUz4DP1fMe9HGsgzPZB8YQ.png" /></figure><p>4. Let’s scroll through and validate the settings we selected on the Review page. After the review is complete, click create auto scaling group.</p><h4>Creating A Load Balancer</h4><ol><li>Now we want to create our load balancer and select application load balancer.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B_TzmyTa08TtL8BkYzxIGw.png" /></figure><p>2. Now create a create name for your load balancer, select internet-facing scheme and IPv4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z3f-2hcX492dALJXh7vvPg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ERGPs6F-RDubR1wvb092Gw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*euZH8XFeDtlMa9oTKZaHMA.png" /></figure><p><em>Trouble Shooting Moment</em></p><p>3. Before you get to Listeners and routing, it is important to create your target group, otherwise you would not be able advance in the creation of the load balancer. Here, because I didn’t have a target group created before this step I selected create target group. Configured my target group then was able to go back in to set up my load balancer this time being able to attach my target group to advance in the set up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*opMEhQOoqis4NxSAuhwQ1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HZox1Me5srEtf4IR-6bRYA.png" /><figcaption>Creating target group</figcaption></figure><p>4. Once your load balancer is created, you can scroll to see your DNS name. Then you can confirm your connection to your instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*6qzhWd-h8RQ_B9NN9TBlsg.png" /></figure><p>Be sure to clean up work environment and delete any resources no longer needed to avoid any unnecessary charges.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f370897bcc7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD Pipelines using GitHub Actions]]></title>
            <link>https://medium.com/@cristendmack/ci-cd-pipelines-using-github-actions-3f7ff23961ca?source=rss-75dd8a1bb4c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f7ff23961ca</guid>
            <category><![CDATA[cloud-engineering]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Cristen Mack]]></dc:creator>
            <pubDate>Tue, 22 Oct 2024 11:49:56 GMT</pubDate>
            <atom:updated>2024-10-22T11:49:56.508Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bbHOJT_BmwrhDavqM9vEnA.png" /></figure><p><strong>What is CI/CD?</strong> It stands for Continuous Integration/Continuous Delivery or Continuous Deployment which is a pipeline where new code is submitted on one end, tested over a series of stages (source, build, test, staging &amp; production), then published as production ready code.</p><p><strong>Key benefits of CI/CD</strong></p><ol><li>Faster time of getting product to market</li><li>Improved quality of code &amp; releases</li><li>Help with cost savings</li><li>Reduce risk of project being exposed to threats in security</li><li>Helps with automation</li></ol><h4>Use Case</h4><p>Create a CI/CD pipeline using GitHub Actions. This pipeline should build and deploy a Nginx image to Docker Hub. The Docker file will outline creating a customized webpage.</p><h4>Prerequisites</h4><ol><li>AWS EC2 Instance</li><li>Visual Studio Code (VS Code) with Docker installed and SSH Remote connection</li><li>Docker Hub account</li><li>GitHub Account</li></ol><h4>Creating A New repository</h4><p>First, we will be setting up a private repository, to make sure personal credentials are not exposed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6pAtpusB-fBJQME8lFZwYg.png" /></figure><p>2. Now let’s set up our secrets for the Docker Hub account. Navigate to Settings &gt; Secrets &amp; Variables &gt; Actions. Here when creating secrets it is important to remember what the secrets are since the secrets will not visibly be shown while creating the pipeline. Seletc New Repository secret once ready to create new secret.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mV2YW4EIEJFzO_uuKTrylQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ViM3lsei3U79UyiHtWt6Fw.png" /></figure><p><strong>Setting up VSCode</strong></p><p>Here we will be creating directories to clone our Github workflow repository into VSCode. We will need to SSH into our EC2 instance. Once in VSCode, we will need to create a main directory &amp; a subdirectory. Our main directory will be called thegha and our subdirectory will be githubworkflows.</p><p>We will now clone thegha from github by using the git clone and copying the repository URL. Once created VS code will signify that this action is done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pgwkowYx2b27XbZCBw0HIQ.png" /></figure><p><strong>Building the Workflow</strong></p><p>Here for this particular workflow we will create three files, in which one will house the yaml file to initiate the worflow once we git the commit to github.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*cdXSF8ESCWW-VZ-tP45biw.png" /></figure><p>Our Dockerfile will contain the following input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*Cq7HFThH6AbjlWqBMdNPeQ.png" /></figure><p>Our index.html file will contain the following input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*a9xrcYol5iAoedEP87umiA.png" /></figure><p><strong>Yaml Workflow</strong></p><p>Formatting here is very important. Be sure to pay attention to spacing and indentation. Also, here is when remember your secrets will come in to place. Note: if you misplace or forget a secret it will be crucial to request or generate new secret in order for the workflow to be configured correctly when getting ready to push code.</p><pre>name: Build and Deploy Nginx to Docker Hub<br> <br>on:<br>  push:<br>    branches: [main]<br><br>jobs:<br>  build-and-push:<br>    runs-on: ubuntu-latest<br><br>    steps:<br>      - name: Checkout Repository<br>        uses: actions/checkout@v4.1.1<br><br>      - name: Log in to Docker Hub<br>        uses: docker/login-action@v3<br>        with:<br>          username: ${{ secrets.DOCKER_HUB_USERNAME }}<br>          password: ${{ secrets.DOCKER_HUB_PASSWORD }}<br><br>      - name: Build and Push Nginx image<br>        uses: docker/build-push-action@v5.2.0<br>        with:<br>          push: true<br>          tags: ${{ secrets.DOCKER_HUB_USERNAME }}/pipelinetest:latest<br><br>  test:<br>    needs: build-and-push<br>    runs-on: ubuntu-latest<br><br>    steps:<br>      - name: Checkout code<br>        uses: actions/checkout@v4.1.1<br><br>      - name: Install Dependencies and Verify<br>        run: |<br>          sudo apt-get update<br>          sudo apt-get install -y curl<br>          curl --version<br>          echo &quot;curl -f http://localhost&quot;<br></pre><p>Pushing Code to GitHub</p><p>After the yaml file is completed, we are now ready to save our files, commit and push our code. To do this we will use the following commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Dm2yomV7psSXJ8jKe3J4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Egf9LTiOrft_OqNqnnt9w.png" /></figure><p>If we navigate to github, we will see our files have been updated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*9wejLj90aKpK8htHZDVPAw.png" /></figure><p><strong>GitHub Automation</strong></p><p>This next step can tend to run quickly so to see the Github Actions in process be sure to toggle to your Github repository under Actions. Initially, I missed Github Actions automation process after running the git push command. When I went under workflows the automation process was already complete. Thankfully, I was able to rerun the process to see the automation in action. Note that once I re-ran the git push command, the terminal alerted me that it was nothing new to commit and everything was up to date. This indicates we have successfully ran github actions with our new workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CBO-R3TOARVWNolEbLpIZw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*mSt-uVeYNrP--kfg6jl2rg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*neSLC1rFc35xRdQOGQCVCg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f7ff23961ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intro to Terraform]]></title>
            <link>https://medium.com/@cristendmack/intro-to-terraform-03d38c47141d?source=rss-75dd8a1bb4c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/03d38c47141d</guid>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Cristen Mack]]></dc:creator>
            <pubDate>Mon, 26 Feb 2024 02:54:40 GMT</pubDate>
            <atom:updated>2024-02-26T02:54:40.400Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JMKmDYlduz2Jindx7lP8pA.png" /></figure><p>Terraform is an open source Infrastructure as code (IaC) allowing users to simplify the process of provisioning and managing infrastructure by using automation. Terraform helps helps interpret configuration files, creates an execution plan, and applies changes to infrastructure. Configuration files are often done in HashiCorp Configuration Language (HCL) or JSON. Providers, resources, blocks, and modules are component of Terraform.</p><h4>Prerequisite</h4><p>Working knowledge of the terraform registry</p><p>Working knowledge of Jenkins</p><p>Access to a Cloud9 IDE</p><h4>Objectives</h4><ol><li>Deploy 1 EC2 Instances in your Default VPC.</li><li>Bootstrap the EC2 instance with a script that will install and start Jenkins.</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 a 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></ol><h4>Let’s Begin!!</h4><p>After Terraform has been installed. Let’s verify to make sure terraform is in our Cloud9 IDE, by using the terraform version command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*oS5doKq9JB5q1QWTUGC7rw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*xgnTa79OOCHTD8oYkmOykQ.png" /></figure><p>Use the user data below</p><pre>#!/bin/bash<br>sudo apt-get update -y<br>sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \<br>  https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key<br>echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \<br>  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \<br>  /etc/apt/sources.list.d/jenkins.list &gt; /dev/null<br>sudo apt-get update -y<br>sudo apt-get install -y fontconfig openjdk-17-jre<br>sudo apt-get install -y jenkins<br>sudo systemctl start jenkins<br>sudo systemctl enable jenkins</pre><p>To configure the EC2 we will use the command below.</p><pre>#Configure the AWS Provider<br>provider &quot;aws&quot; {<br>  region = &quot;us-east-2&quot;<br>  }<br><br>resource &quot;awsinstance&quot; &quot;Terraform_Jenkins&quot; {<br>    ami           = &quot;ami-002b2c20f49afcd3a&quot;<br>    instance type = &quot;t2.micro&quot;<br>    user data     = file(Install_jenkins.sh)<br>    tags = {<br>      Name = thejenkins-instance&quot;<br>    }<br>  }<br>    <br> resource &quot;aws_terraform_vpc&quot; &quot;default&quot; {}<br> <br>resource &quot;aws_keypair&quot; &quot;jenkins_keypair&quot; {<br>  key_name   = &quot;TerraformJenkinsKP&quot;<br>  public_key = tls_private_key.jenkins_key_pair.public_key_openssh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S9WGqHc2EGtSbHW8uiD_9g.png" /></figure><p>Now, we’re ready to set up our security group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ru5AkUCIzKHH8_OU6yDCPQ.png" /></figure><p>Afterwards, let’s create our S3 buckets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Mp6IWCwkK6YWSBbpUjILg.png" /></figure><p>We will use the below code to download the provider.</p><pre>terraform init</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ItN0eoOzobFctZYj7m2zig.png" /></figure><pre>terraform validate</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*PRntntHMOLcx_hj_0MXQzA.png" /></figure><p>Terraform validate confirms that are changes have executed and we can now access Jenkins by using the IP address and port :8080 to access Jenkins “<strong>https:/localhost:8080”.</strong></p><p>Utilize the command below to access Jenkins.</p><pre>sudo cat /var/lib/jenkins/secrets/initialAdminPassword</pre><p>Once entered we have successfully accessed Jenkins by using Terraform!!!</p><h4>Resources</h4><p>Configuration Language</p><p><a href="https://developer.hashicorp.com/terraform/language">Overview - Configuration Language | Terraform | HashiCorp Developer</a></p><p>Provider Configuration</p><p><a href="https://developer.hashicorp.com/terraform/language/providers/configuration?utm_source=tf_registry&amp;utm_content=sidebar">Provider Configuration - Configuration Language | Terraform | HashiCorp Developer</a></p><p>Linux</p><p><a href="https://www.jenkins.io/doc/book/installing/linux/">Linux</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=03d38c47141d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up a MySQL & WordPress Using Docker Swarm]]></title>
            <link>https://medium.com/@cristendmack/setting-up-a-mysql-workpress-using-docker-swarm-0261000567f9?source=rss-75dd8a1bb4c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/0261000567f9</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[mysql]]></category>
            <dc:creator><![CDATA[Cristen Mack]]></dc:creator>
            <pubDate>Sun, 25 Feb 2024 17:09:30 GMT</pubDate>
            <atom:updated>2024-02-25T17:09:45.778Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mmFmL094x741T7dx5okmcw.png" /></figure><h4>Networks</h4><p>What are frontend versus back end networks. For frontend network it is what the user will see such as when viewing a website. Now for backend network think of the nuts and bolts of what is needed to run and support the website. Some components of a backend network are the databases, application programming interfaces (api), and security measures.</p><h4>Objectives</h4><ol><li>Deploy a 3 node Docker Swarm cluster.</li><li>Create 2 networks. One for frontend and another for backend.</li><li>Create MySQL service associated with the backend network, and only 1 replica. Make the database service resilient and its data persistent across container restarts, use Docker Volumes.</li><li>Create the Wordpress service associated with the frontend network, accessible from the browser, 3 replicas, and associated with the MySQL service.</li></ol><h4>Let’s Begin!!</h4><p>Setting up a Docker Swarm. Please check out my previous article here.</p><p><a href="https://medium.com/@cristendmack/getting-started-with-docker-swarm-faed1005265e">Getting Started with Docker Swarm</a></p><h4>Creating a Frontend &amp; Backend Network</h4><p>Let’s create our 2 networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TyVB0cbLTtkE2BQEiYqV5w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*F-lU6og07Z8YTn17HuxU4g.png" /></figure><h4>Create a MySQL</h4><p>First, let’s create our docker volume to make data persistent across container restarts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*2TG-mdSLqmXJ1is48RaBYw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*uhtwju-b0AXbXPZzSh1duQ.png" /></figure><p>Next, let’s create a MySQL service and attach the volume and the network.</p><pre>sudo docker service create --name mysql-service --replicas 1 --network backend-network --mount type=volume,source=mysql-data,target=/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=wordpress mysql:latest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ibnQYHs5LJoZfg0in3UkQ.png" /></figure><p>Below indicates our service has now been replicated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y2Ng7SBa3kC4H1wNl6RiSw.png" /></figure><h4>Create the WordPress Service</h4><p>Here we will want our WordPress Service to associate with frontend network, use port 80, and reflect 3 replicas, and our MySQL service.</p><pre>sudo docker service create --name wordpress-service --replicas 3 --network frontend-network -p 80:80 wordpress:latest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z4f2LhKIdFjFhi2y1O8yow.png" /></figure><h4>Now Let’s Test it</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bhFzgv5_B7NLtRoHVUizqw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zdWRgOumqHgyo6DiNw-G4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_qxG1oXFhuqlQSbxOftybA.png" /></figure><p>Now that we know our code is accessible, we will want to navigate to retrieve the public IP address. Once accessed you should see the below screen indicating that we have reached out Wordpress website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*EDS2r-1jKez3PX0L5OWWZQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LIHC4rJvS5AkbyIowzcq7g.png" /></figure><h4>Reminder</h4><p>Be sure to clean up workspace by deleting any code no longer needed such as removing any service, detaching volume and networks, and leaving swarm. Also, be sure to stop any EC2 instances no longer needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*Kuo9bRU_HIAQYLGRidF-4g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0261000567f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Docker Swarm]]></title>
            <link>https://medium.com/@cristendmack/getting-started-with-docker-swarm-faed1005265e?source=rss-75dd8a1bb4c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/faed1005265e</guid>
            <category><![CDATA[node]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-swarm]]></category>
            <dc:creator><![CDATA[Cristen Mack]]></dc:creator>
            <pubDate>Sat, 24 Feb 2024 18:08:17 GMT</pubDate>
            <atom:updated>2024-02-24T18:08:17.484Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hzf6gtHLuqluj5nBnWRlMA.png" /></figure><p>What is Docker Swarm? Docker swarm is an orchestration tool for Docker containers that allow the creation and management of Docker nodes to deploy and scale container application across multiple multiple machines. Think of it as a production set. Docker Swarm would serve as the director managing the actors and making sure each actor is in the proper place for each seen. Docker would serve as an actor. Now, when you see the term node in Docker Swarm it is an instance of a docker engine. A node can be a worker or manager node.</p><h4>Objectives:</h4><ul><li>Installing docker on all hosts</li><li>Verifying that docker is in an active state</li><li>Change the hostname on each node to identify the master node (node 1) and the two worker nodes and validate all nodes share the same security group</li><li>Ssh key to each node</li><li>Creating the Swarm using one master node and two worker nodes</li><li>Show the status of the docker nodes</li></ul><p>For set up of docker swarm I will use the VS code with Docker Installed.</p><h4>Let’s get Started!!</h4><p>For our nodes, I will be using the Ubuntu Server 22.04 LTS AMI. Be sure to select the same key and same VPC for each node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dNGTB9Jtr-eOCl3or4jG9w.png" /></figure><p>Here we will set up our security group. We want all 3 nodes to use the same security groups.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fuxJZMYJGLh83-AOQK97IQ.png" /></figure><p>After this is set up, lets navigate to our VS code and be sure to ensure docker is set up on each node by running this command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*VEq0DL9E50szkT4kt6wAwA.png" /></figure><p>We will want to ssh into our node1.pem file. By running the ls command, you will be able to see your node1.pem file. Here mine is labeled as “DOCKERKP.pem”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*ra4RBzN264lvK7C5Iv-cOg.png" /></figure><p>Next, let’s set up our nano configswarm to add the set up for node2 &amp; node3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*78PWCyL7r_K_X0JnnN8z0Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*874aaMw5-Q9yzpkmtxx-PA.png" /></figure><p>Now open two new terminals, to be able to SSH into instances for node2 and node3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N1m5mDl6Sopv4SRfXySrQg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8OUYARNQ0p8BE_hu1572ug.png" /></figure><p>We will change the hostname on both nodes, by using this command. Your node name by vary according to how you labeled your instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*hVGPppkghzj3VNMgj-Buvw.png" /></figure><p>Once updated you will have three nodes as reflected below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4TyAZ-sBzrTBtKLYuC5uVw.png" /></figure><p>Now we’re ready to initiate the swarm! The command to initiate is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*yhlmUs7QPrKbyEexg78unw.png" /><figcaption>Be sure to use the private ip address</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*2ZA0vXllLLzJ6DTk8b75UA.png" /></figure><p>Yes! We have successfully connected to the Docker Swarm. Now let’s add our worker nodes, node2 and node3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*i-Ph4GDB3e-xkAYauCduvw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*-I7JmNugtWsvCK8QBNrsrQ.png" /></figure><p>Once connected, let’s run the command below, to show the status of our nodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*adJh7F0pcrNozRVW1U1C7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mn70KhSrq3sO6hDw6PrO4A.png" /></figure><p>This signifies our a Docker swarm successfully has been set up with our manager node as node1, and our two worker nodes as node2 and node3.</p><h4>Important Reminder</h4><p>To leave the swarm use command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*YCUf0l_xN2WDzLhZLe7X3A.png" /></figure><p>Also, be sure to stop and terminate any running instances that are no longer needed to avoid unnecessary charges.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=faed1005265e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Boto 3 & Utilizing Lambda to Stop Instances]]></title>
            <link>https://medium.com/@cristendmack/boto-3-to-stop-instances-with-lambda-54fda205749a?source=rss-75dd8a1bb4c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/54fda205749a</guid>
            <category><![CDATA[boto3]]></category>
            <category><![CDATA[ec2-instance]]></category>
            <category><![CDATA[lambda]]></category>
            <dc:creator><![CDATA[Cristen Mack]]></dc:creator>
            <pubDate>Fri, 23 Feb 2024 05:19:42 GMT</pubDate>
            <atom:updated>2024-02-23T07:41:51.477Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JFjSYJ5jUxndkUrP9os8Sw.jpeg" /></figure><p>Boto3 is a Python Library that serves as a AWS software development kit (SDK) . It provides an user friendly interface for developers to interact with several various AWS services allowing you to create and modify AWS resources using Python. With Boto3 it allows you to build create scripts and management AWS resources utilizing the command line.</p><p>Now that we know about Boto3, here’s some more terms to know.</p><h4><strong>AWS Lambda</strong></h4><p>A serverless service that runs as an event driven programming model allowing developers to build and deploy applications that respond to triggers or events. Lambda allows code to run with managing the servers. with running code as functions responding to events</p><h4><strong>AWS EventBridge</strong></h4><p>A serverless event bus service that allows the user to build/create event rules that match events based on predefined criteria. This makes it easier to connect application with data from a variety of sources by helping simplify ingesting, filtering, transforming, and delivering events.</p><h4>Cloud 9</h4><p>An AWS Integrated development environment (IDE) that enables developers to write, run, and debug code using the cloud.</p><blockquote><strong>Use Case</strong></blockquote><p>Your 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><p>You will need to make sure all Development Instance are stopped at a designated time of 7pm.</p><p>To ensure this we will use a Lambda function using Python with EventBridge to ensure it runs on a set schedule daily, while most importantly making sure no one is working past 7pm.</p><h4><strong>Let’s Begin!!</strong></h4><h4>Create a python script that stops all running EC2 instances.</h4><ol><li>Start with installing boto3 on your cloud9 IDE on AWS and save code. Be sure to save as a python file when save this environment setting after the boto3 has successfully installed.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*j91yqcktxE9E52ktMWvn4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VeYN08zDEk_CrLeLeX5BIw.png" /></figure><p>The script below is what was use to explore and stop our test EC2 instances to test our code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/37700f4745dbd509f4388638392d1d12/href">https://medium.com/media/37700f4745dbd509f4388638392d1d12/href</a></iframe><p>Now that our code is created, we are ready to launch test instances to test our code. Once the instances are created run the code at the top right of Cloud9 to verify the code is working. When completed successfully you will see that the test instances are now stopped.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7a75V4ZQan9AuxshZ2RRBQ.png" /></figure><h4>Creating a Lambda function using Python 3.8 or higher &amp; Creating EventBridge Schedule to run Python script.</h4><p>For this segment, we think what do we want our Lambda function to accomplish? To start let’s head over to AWS Lambda dashboard. Once here let’s select Create Function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ejKUfKCCohoByzIzB4Svfg.png" /></figure><p>Here will create function from scratch to give us the flexibility we need. Now that I’ve given you time to think about what we want to accomplish with lambda. We can name that as our lambda name. Here I have named function as ‘StoppingEC2Instances’, and have selected the Python 3.12.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yOvURgHLgHIFVQJYpGYLdQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iEeK0zMff38VBegTUGeSDw.png" /></figure><p>After our Function is created, let’s assign permissions to it by returning back to the IAM Dashboard and selecting policies.</p><p>First, let’s choose a IAM policy for the Lambda to execute our function. Then we will proceed to attaching an IAM role for the Lambda.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vI2yNrYWRysqX1C1BJmK1g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ddYM9AGEoexGZd54QtGUkg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wCtggL4mJ-S0W6jxwYaJtg.png" /></figure><p>Once we select our newly found, we will toggle over to the Lambda Function under the Code source and add our boto3 code and test our code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_f0MQO08v21BTUrpfXBkpg.png" /></figure><p>Below, after running our test lamda function, the status succeeded and this verifies the code works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nd9MboopfRhSTdBJ-WIoLg.png" /></figure><h4>Creating an EventBridge Schedule For Lambda</h4><p>The next task is for our lambda to run on a set schedule. Here our goal is to make sure lambda invokes everyday at 7pm sharp. Let’s navigate to Amazon EventBridge dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*QF5RrM5k8oyzUO_uZT2lPw.png" /></figure><p>Here will will name the Schedule and describe the function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7KdFzAhyFqEjzMUL5IpbpA.png" /></figure><p>Next, we will set the schedule to recurring and note here it will be important to set the target time to 7pm to reach our goal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mLFp9XfGf_ikh8YbBZGv_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yWVCS3rw4TYhpjSOiFaiGg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*1ZUa5guYSQaZ9jkDtz_9iA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JyLzPtzv4BglBkPmOyoTfg.png" /></figure><p>We’re ready to create our schedule. Once created under our schedule we will find our newly created schedule “7pmInstancesStop”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fw_2i9rCoVSrqMLwpHVVhQ.png" /></figure><h4><strong>We did it!!!</strong></h4><p>Be sure to disable or delete scheduler to avoid any unnecessary charges.</p><p><strong>Resources</strong></p><p>SDK for Python</p><p><a href="https://aws.amazon.com/sdk-for-python/">https://aws.amazon.com/sdk-for-python/</a></p><p>Boto 3 Documentation <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/index.html">https://boto3.amazonaws.com/v1/documentation/api/latest/index.html</a></p><p>My Boto Command Code Link:</p><p><a href="https://github.com/cmack21/Python/blob/main/boto3_">https://github.com/cmack21/Python/blob/main/boto3_</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54fda205749a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Scripting]]></title>
            <link>https://medium.com/@cristendmack/python-scripting-42ecc48a0084?source=rss-75dd8a1bb4c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/42ecc48a0084</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[scripting]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[script]]></category>
            <dc:creator><![CDATA[Cristen Mack]]></dc:creator>
            <pubDate>Sun, 18 Feb 2024 08:58:31 GMT</pubDate>
            <atom:updated>2024-02-18T09:14:04.187Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vs44AN6sr-ArNwwTLgg9Ng.png" /></figure><p><em>Python Scripting can be used to locate files and collect information about certain files. This can be used with assisting companies with file organization when needed. For this article, I will be discussing how to use Python script to generate list of dictionaries abut files in the working directory.</em></p><h4><strong>Prerequisites</strong></h4><p>-Working knowledge of Python</p><p>-Knowledge of using AWS cloud 9</p><h4>Python terms to know</h4><p>List- data structure that is used for storing item collections</p><p>Dictionary- used for storing collection of key-value pairs</p><p>Iteration: accessing each element in a collection, one at a time, when performing specific requested operations</p><p>Below is the script that was ran in cloud9, split in four parts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JX1vhWzLdVFQVy6NmZfPbQ.png" /><figcaption>A</figcaption></figure><p>A. First let’s import the os module. This allows interacting with the operating system. Next, we will seek access to the current working directory and all the files listed in this working directory. Here we can create an empty list to store file information for later use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HbZi538YQtwBeOTJ0wXmAA.png" /><figcaption>B</figcaption></figure><p>B. By running these sets of commands allows for loop file exploration in the directory list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YRMY7j86oAlDa-RONveryQ.png" /><figcaption>C</figcaption></figure><p>C. We are able to create our dictionary and append the dictionary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QzI0iyKDoNM-L9rzATWoHA.png" /><figcaption>D</figcaption></figure><p>D. Printing our findings. Here there’s several ways we can print. You can choose which one you prefer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R3dmz_BWB1iF6kpPJzilLg.png" /><figcaption>Output in Cloud9</figcaption></figure><p>After successfully completing, the code is ready to be push to the main branch in your GitHub.</p><h4>Resources</h4><p>os Module:</p><p><a href="https://docs.python.org/3/library/os.html">os - Miscellaneous operating system interfaces</a></p><p>Github code link:</p><p><a href="https://github.com/cmack21/Python/blob/main/Scripting.py">https://github.com/cmack21/Python/blob/main/Scripting.py</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42ecc48a0084" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top NBA Scorers using a DynamoDB Table]]></title>
            <link>https://medium.com/@cristendmack/top-nba-scorers-using-a-dynamodb-table-0b84506fe32c?source=rss-75dd8a1bb4c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/0b84506fe32c</guid>
            <category><![CDATA[aws-dynamodb]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <category><![CDATA[dynamodb]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Cristen Mack]]></dc:creator>
            <pubDate>Sun, 18 Feb 2024 00:25:37 GMT</pubDate>
            <atom:updated>2024-02-18T00:28:46.262Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XXEAJ4G3aRpmcqBHp7jKIg.png" /></figure><p>In this article we will dive into DynamoDB on AWS. Dynamo DB is a NoSQL(No Structured Query Language) database that is fully managed. NoSQL is a databases provide more flexibility in storing and retrieving data. Data is stored in rows and columns. With DynamoDB being a managed service that means the user does not have to take on setting up servers, managing software updates or handling backups. Pretty cool, right?</p><h4>Terms to Know before we set up our DynamoDB table.</h4><p><strong>Partition key</strong>: Unique identifier assigned to a particular row in a database, determining how DyamoDB distributes and stores data across the server</p><p><strong>Sort key:</strong> helps with how the date with be ordered using the same partition key</p><p><strong>IAM Role:</strong> a role assigned to grant permissions securely and have the least privilege access within AWS</p><h4><strong>Objectives</strong></h4><ul><li>Create a DynamoDB of your desired topic &amp; Add at least 10 items to the table</li><li>Create an EC2 Instance</li><li>Grant the EC2 instance read access to DynamoDB, using the IAM role.</li><li>Utilize the AWS CLI in the EC2 instance to scan the DynamoDB table</li><li>Utilize the AWS CLI in the EC2 instance to validate you can not write an item to the DynamoDB table.</li></ul><h3><strong>Let’s Begin!!!</strong></h3><h4>Create a DynamoDB Table</h4><ol><li>Let’s start by logging into your AWS management console &amp; searching for DynamoDB.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dIXCpwPaGOEM_wFTZ0t8nQ.png" /></figure><p>2. Once here select Create Table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-LBhXa9SVo2CRcwzrpBeNw.png" /></figure><p>3. After selecting you will enter in your desired table name with the partition key and sort key. Here please note the main difference between string and number. String is a sequence of characters normally represented by text, such as “hello world”. Number will represent numerical values, such as 43,208.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pTdYLdJgc3lulvaBDVV79w.png" /></figure><p>4. We have the option to create a customize table with advanced features, however for the purpose of this table we will leave it with the default settings. Once selected we are ready to select, Create table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eoOLNfihxcinovtrj-xTUA.png" /></figure><p>5. Once our table is create, we will locate Explore items and select our table. There currently are no items under our table, so here you can add your desired 10 entries. You will create an item for each entry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*HX6ALEnrerouCrn0ixeqLQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WtKUmjHYSL-BWVUmYdrBpQ.png" /></figure><p>6. Here, I added the top 10 NBA players with the most points scored.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*jVzb0oDDldgETvk3li9AEQ.png" /></figure><h4><strong>Creating an Instance</strong></h4><p>Now we are ready to Create our EC2 Instance. We will name our instance, choose the free tier t2.micro and create a new key pair or use an existing key pair for this instance. For the instance, we will leave the Network settings, Configure storage and Advance details as default and Launch our instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*6kvQBU6hIuNc8HuCE-XSiw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9vYB5ZXxpIVDqLF5-kuqyA.png" /></figure><p>DynamoDB_blue is the newly created instance.</p><h4>Creating an IAM role with Permissions</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*6atTx3_Q4MAMTctBkvRJwA.png" /></figure><ol><li>We will locate the IAM by entering IAM into the search bar. Once selected we will navigate to role and select Create role. Once here will use the default settings for AWS service and select EC2.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rk2bvFIxrXTEFThUcywdTg.png" /></figure><p>2. We will want to select the AmazonDynamoDBReadOnlyAccess, because this will create the permission for the table to not be edited outside of what was initially created for the table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9JH3bZoFqj9J_fdjayDpiw.png" /></figure><p>3. Here we will name our Role, here come up with a name that will be easy for you to remember. After name the Role, select Create Role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JsKuTEo_H1SMCPmvJzMhSw.png" /></figure><p>4. The pop up below will appear when we have successfully created the new role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*wIuX4UBZCS-_Ur8JbBCiZw.png" /></figure><h4>Attaching an IAM role to the instance</h4><ol><li>Once your instance is running, you want to add the IAM role. Click on Actions and select Security. Select Modify role, then select Update IAM Role.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NQ7r89FgMa-1-0PRUBIfiA.png" /></figure><p>2. Once here we will want to modify our to our newly created ReadOnly permission. Once the screen below populates select update IAM role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rDKGzLiWYPW4nv9agq_Gvw.png" /></figure><h4>Utilize the AWS CLI in the EC2 instance to scan the DynamoDB table</h4><ol><li>Once our newly created EC2 instance running, we are ready to connect and ssh into our instance.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fuvPI4ttnCSlWCB9QhkZ9A.png" /></figure><p>2. You will see the pop up below once in your terminal, after successfully ssh into our instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HAV_hiXpRSARCTJ3Vc94gQ.png" /></figure><h4><strong>Scan DynamoDB Table and Permissions Read Access Test</strong></h4><ol><li>To scan your table you will want to use the command.</li></ol><p>aws dynamodb scan — table-name &lt;your table name&gt; — max-items 10</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rNSKRoyNzESZNV4E-0Cg_A.png" /></figure><p>2. Let’s take it a step further. To verify the table can not be edited, but only read we can follow the following command.</p><p>aws dynamodb put-item — table-name &lt;desiredtablename&gt; — item \ ‘{“paritionkey”: {“S”: “&lt;value&gt;”}}’ — region us-east-1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nWHZuVuNCMPK3OWZ6YGN-Q.png" /></figure><p>Yay!!! This has successfully completed once you see the AccessDeniedException. This will indicate this is an invalid occurrence.</p><p>Be sure to stop all running instances and delete any resources no longer needed to avoid any unnecessary charges.</p><p>Thanks for tuning into this article, as I continue to embark on my journey into the exciting world of cloud computing!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0b84506fe32c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Your Very Own AMI]]></title>
            <link>https://medium.com/@cristendmack/creating-your-very-own-ami-1ca0212487d3?source=rss-75dd8a1bb4c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ca0212487d3</guid>
            <dc:creator><![CDATA[Cristen Mack]]></dc:creator>
            <pubDate>Sat, 10 Feb 2024 05:49:47 GMT</pubDate>
            <atom:updated>2024-02-12T22:54:28.105Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0z0wvHSQQ0cFVAC7-Jk_dg.png" /></figure><p>In this article, we will be creating our AMI the instance we create and verify the web server.</p><p><strong>Terms to Know</strong>:</p><p>AMI: a template containing the software configuration to launch your instance</p><p>security group: a firewall for the instance, controlling inbound and outbound traffic.</p><p>user data: gives the flexibility to customize behavior of the instance. User data often times is provided in plain text or shell scripts</p><h3>Let’s Begin!!!</h3><p><strong>The Steps</strong>:</p><ol><li>Log into your AWS console and select Launch Instance, once entered into your EC2.</li><li>Create a t2.micros EC2 instance (using the free tier)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Ucgix_Wo8_g9tU9_EBokQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y1L9XG_F4C9KfW58BYBQpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Yy_EQp_ZnGXT8Ut1tXniA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OZL7Kk8pqvCU4HbpPQLTPA.png" /></figure><p>3. In the user data field, I used CentOS since all the packages, and Apache services were recently updated in a prior project. The main thing if you choose to use a different AMI be sure to update to the latest packages and Apache services.</p><p>4. Now we can create our security group. Here we will stick with allowing the SSH into your designated IP address. Also, here we can allow http traffic from the internet as our endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PDUvFRHQ0pTcU04qJ_J7kw.png" /></figure><p>6. Now to input your user data into this instance, scroll to Advanced details.</p><p>Use the following script:</p><p>#!/bin/bash<br>yum update -y<br>yum install -y httpd<br>systemctl start httpd<br>systemctl enable httpd</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GFExpozmCEJNGYJ_MEwLOg.png" /></figure><p>Now we’re ready to launch our instance.</p><p>7. After launching, take the copy &amp; paste the public IPv4 address into the private browser. Here as you see below our public IPv4 address is 54.226.173.178.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*e3fA9SceEZHQIh3C211WSw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Itj-GzjoKBW7scEHxmaBQw.png" /></figure><p>8. Now that we have verified our user data works, let’s create an AMI using our newly created EC2 instance. Here we want to select Actions and scroll down to Image and templated were will will find create image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*q9WJRDx0X5aNWmjpZPY3ag.png" /></figure><p>9. Select the Create Image icon at the bottom of the screen once selected. The screen below will appear and will will name the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R2bbF9x-tC4_50nNsU5b2w.png" /></figure><p>10. Now, let’s navigate to the AMI dashboard, under image. Once here select the newly created AMI instance from AMI. We are ready to now launch the instance from the AMI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*McdLzWawdUHc8DFGWMurZg.png" /></figure><p>11. We will use same process again and utilize the same key pair and security group in the last instance created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Gp0bJSJAOGQTX-TBt7XMg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1c5_F1NxPLJvNR6NyZgi8A.png" /></figure><p>12. Now we are ready to check to see if our newly created web browser works. This time we will use Public IPv4 address: 54.160.160.78.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hoMKNSUoSi271yQF1v9DEg.png" /></figure><h3>WE DID IT!!!!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ca0212487d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jenkins & Docker: Teamwork at its Finest]]></title>
            <link>https://medium.com/@cristendmack/jenkins-docker-teamwork-at-its-finest-21b5d4da2481?source=rss-75dd8a1bb4c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/21b5d4da2481</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[Cristen Mack]]></dc:creator>
            <pubDate>Mon, 05 Feb 2024 00:47:53 GMT</pubDate>
            <atom:updated>2024-02-08T04:11:13.516Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eoJ4pYys-E_BBD607g5ShA.png" /></figure><p><strong>First Things First</strong></p><p>Have you ever wonder can I have a personal assistant for building computer programs? Jenkins serves just as that. Think of Jenkins as a super organized personal assistant to building, testing, and deploying programs. Jenkins helps ensure programs can be built and tested without things getting too convoluted. Jenkins helps with automating the process from the beginning stages of creating code to building, testing, and deploying in the CI/CD pipeline.</p><p>Docker serves as our handy dandy tool man, that helps to package applications and their designated components into containers that are easily accessible. Volumes serves as our storage center for data outside of the containers.</p><p>This terrific teamwork of Jenkins and Docker helps in automating the entire development cycle taking care of tasks and Docker ensures there is flexible in our workspaces to sure efficiency and reliability.</p><p><strong>Use Case</strong></p><p>Using the CLI</p><ol><li>Pull the Jenkins LTS image from Docker Hub.</li><li>Create a Docker volume for Jenkins to persist its data.</li><li>Run the container with the volume and correct port mapped to the container.</li><li>Retrieve the Admin password.</li><li>Login and create a new user.</li><li>Launch a new Jenkins container using the same volume and verify that the data has persisted by logging in as the newly created user.</li></ol><p><strong>Perquisites:</strong></p><ol><li>A working knowledge of SSH into VS Code</li><li>Access to Docker Hub to access Jenkins</li></ol><p>Getting started!</p><p>Let’s pull our Jenkins Image from Dockerhub. Once there you will find the commands to install Jenkins</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zt5wotlQiXS9JKxNwWG4Bw.png" /></figure><p>We will use the sudo docker pull jenkins/jenkins:lts command to pull the latest version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x16oePvxBOY9ibadsfTW6A.png" /></figure><p>Let’s run the volume create command to create the volume. We will name it jenkins-volume. Here you can create different volumes if desired.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C8jTf9TRhD1R74ELsztNvA.png" /></figure><p>Next let’s check our volumes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7c1xdGg_Tll8Sot5FMCb9A.png" /></figure><p>Now let’s run the container with our volume attached and make sure the port mapping is correct.</p><p>Quick terms to consider:</p><ul><li>-d Help run the container in the background</li><li>-v jenkins_data:/var/jenkins_home: Assist with mounting our created volume to Jenkins data</li></ul><p>Ports</p><ul><li>-p 8080:8080: Maps host port 8080 to container port 8080, which serves as the Jenkins web interface</li><li>-p 50000:50000: Maps host port 50000 to container port 5000, which serves as the Jenkins agent</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lzzPwMysQJQ1sNhdyXyv7Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GVNE9kW2ACGpJtwNerBdrw.png" /><figcaption>Here we can check to see what containers are running by using sudo docker ps</figcaption></figure><p><strong>Password &amp; Login To Create New User</strong></p><p>To retrieve our password we can use.</p><p>sudo docker exec container_jenkins cat /var/jenkins_home/secrets/initialAdminPassword</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DxhIQbl6P2BkVPilYGYSFA.png" /></figure><p>After this command is ran to retrieve our password, open a fresh web page and enter in <a href="http://localhost:8080.">http://localhost:8080.</a></p><p>Our local host we will use is 3.133.85.38.</p><p>Once reach you will find the getting start prompt on the Jenkins web interface. Here you will follow the prompts to get set up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uEFy_t4r-jImL69dNwkzag.png" /></figure><p>After placing in password you will see this screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UONP2BPY6pw2euwkfQjeTg.png" /></figure><p>Here we will want to install suggested plugins. Then Create Our First Admin User</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iVFQyhT7SP4nR2twb0Jzhg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*srGkc1eczk_uQKYYqxm3eg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aYeACN_beMNwBwAdnxX8_A.png" /></figure><p><strong>Creating a new container to Verify Our Volume Data</strong></p><p>Let’s launch another jenkins container using the same volume and verify that our data will remain. To begin we will want to stop our running container by using</p><p>sudo docker container stop container_jenkins</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*7De8oTuB0iAXxj7AFMMLOw.png" /></figure><p>The command docker ps -a will show all of our most recent container and show that we have exited our container, container_jenkins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6AaWkxQuevuXyCJ9GQoSWg.png" /></figure><p>Let’s now launch a new container with the same command. This time will name it container_jenkins2</p><p>We will use this command:</p><p>sudo docker run -d -p 80:8080 -p 50000:50000 — name container_jenkins2 -v sudo docker run -d -p 8080:8080 -p 50000:50000 -v jenkins_data:/var/jenkins_home — name container_jenkins2 jenkins/jenkins:lts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1PUwUovJ7jzoLoiMynLE4Q.png" /></figure><p>Now once created we can go back to accessing our public IPv4 address listed below. Once successfully logged into Jenkins you will see the below screen!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JvUe9cp9IOu-jxebUGqdUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z-peDXIX3KlFc0G3AozAFA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21b5d4da2481" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>