<?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 Janelle Williams on Medium]]></title>
        <description><![CDATA[Stories by Janelle Williams on Medium]]></description>
        <link>https://medium.com/@janelle_williams?source=rss-120573f1c241------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*OmHI1ZZOxfui6qk4</url>
            <title>Stories by Janelle Williams on Medium</title>
            <link>https://medium.com/@janelle_williams?source=rss-120573f1c241------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 07:51:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@janelle_williams/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[Docker: Using Terraform To Deploy A Docker Image To An ECS Cluster]]></title>
            <link>https://medium.com/@janelle_williams/docker-using-terraform-to-deploy-a-docker-image-to-an-ecs-cluster-5e471baaec35?source=rss-120573f1c241------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e471baaec35</guid>
            <dc:creator><![CDATA[Janelle Williams]]></dc:creator>
            <pubDate>Sun, 23 Oct 2022 23:49:47 GMT</pubDate>
            <atom:updated>2022-10-24T00:52:33.079Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*LFai0WshA-f56RiiEQMpaw.png" /></figure><h3>You will need:</h3><ul><li>An AWS account</li><li>You will need a source code editor. I prefer using Visual Studio Code or AWS Cloud9, but Terraform and AWS CLI must be installed on them</li></ul><p>Step 1:</p><p>Open your code editor, create, and name your new folder or directory.</p><p>Create the files we’ll need in the new folder/directory. Create your files.</p><pre>main.tf providers.tf resources.tf </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/126/1*YqbAny0LfCbwPcFQBvMQaw.png" /></figure><p>Once you’ve created your files, it’s time add code to each file.</p><p>Step 2. Code</p><p>Now, we’ll add the code we need into each file. Let’s start with the <em>main.tf </em>file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*WznCn93cPANZJpoGmWy-4w.png" /></figure><p>Then, the <em>providers.tf </em>file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/266/1*72wu1XF8OnjCmanf2_aWag.png" /></figure><p>Now, the <em>resources.tf</em> file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*7efW_OvRlHih-R3EC3nfcQ.png" /></figure><p>Remember to edit the code to include the availability zones and other necessary settings that may apply to you.</p><p>Step 3: Validation</p><p>Now before deploying, let’s make sure everything is working as expected. Run the following command and see if you yield the same results:</p><pre>terraform init</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*-VG4gFXTh3IPtHrYXj3x_A.png" /></figure><p>Next, run this command to make sure our files are configured correctly:</p><pre>terraform validate</pre><p>You should receive a message of ‘Success’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*q4G3wc3GIxy1eXSIwM0d7w.png" /></figure><p>You can run this command to see the layout or infrastructure of everything that’s being created:</p><pre>Terraform plan</pre><p>To run the infrastructure, you can run the ‘apply’ command:</p><pre>Terraform apply</pre><p>Finally, check Amazon ECS →Cluster to make sure our cluster actually deployed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*WR6y1trDtaw6kz2UrlfWzw.png" /></figure><p>Mission accomplished.</p><p>Don’t forget to remove all your resources with this command:</p><pre>terraform destroy</pre><p>Thank you for reading my article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e471baaec35" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configure Nginx Web Server using AWS EC2 User Data]]></title>
            <link>https://medium.com/@janelle_williams/configure-nginx-web-server-using-aws-ec2-user-data-b21c018c8348?source=rss-120573f1c241------2</link>
            <guid isPermaLink="false">https://medium.com/p/b21c018c8348</guid>
            <dc:creator><![CDATA[Janelle Williams]]></dc:creator>
            <pubDate>Sun, 23 Oct 2022 20:31:42 GMT</pubDate>
            <atom:updated>2022-10-23T20:31:42.216Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*3VsKpiX6VeAtlkoJ.png" /></figure><p>Nginx is an open-source, free to use web server that anyone can use to host a website.</p><p>Today we’ll learn how to create an Amazon EC2 instance with an Nginx web server. We’ll be using the AWS Command Line Interface (AWS CLI) to launch it.</p><h3>What you’ll need:</h3><p>An AWS account</p><h3>Overview:</h3><ol><li>Create an EC2 Instance</li><li>Configure a security group to allow traffic to the instance</li><li>Configure an instance user script to boot up the Nginx web server</li></ol><p>Step 1.</p><ul><li>In AWS, search for EC2 in the search bar.</li><li>To create a new instance, click on Launch Instance.</li><li>Choose an instance name and select the Amazon Linux 2 AMI (free tier eligible).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*zvdcQhTa0GRqejIORaYGDA.png" /></figure><ul><li>Select the t2 micro instance type (the free eligible tier)</li><li>Create a key pair if you don’t have one already</li><li>Then, configure the security group to allow HTTP traffic from the internet</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*C6C-n3Q2YJSyelZBOzoKGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*YomnAXoKJsSOcSV3DWxbJA.png" /></figure><ul><li>In the<strong> </strong>Advance details, we are going to enter the following script in the user data field which will setup and install the Nginx web server on the initial instance launch</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/0*eSGHs6oNy2UJMICx.png" /></figure><ul><li>Click on <strong>Launch instance</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*chY-8SvvteA5bLG6.png" /></figure><ul><li>Let’s check to see if we’ve successfully installed the Nginx web server. Go to your instances, copy the public IP address, and paste it into your browser. You should see the Nginx test page and it will look like this:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*8BqwZJKvnu6Eyfgf3r1wMA.png" /></figure><p>You’ve successfully installed an Nginx Web Server on an AWS EC2 instance, great job!</p><p>Thanks for reading my article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b21c018c8348" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terraform: Deploy a Two-Tier Architecture]]></title>
            <link>https://medium.com/@janelle_williams/terraform-deploy-a-two-tier-architecture-5639f90a1f41?source=rss-120573f1c241------2</link>
            <guid isPermaLink="false">https://medium.com/p/5639f90a1f41</guid>
            <dc:creator><![CDATA[Janelle Williams]]></dc:creator>
            <pubDate>Sun, 23 Oct 2022 18:59:00 GMT</pubDate>
            <atom:updated>2022-10-24T01:24:26.410Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*SK5GuABN9Ljg21Qdw9EMSA.jpeg" /></figure><p>Project:</p><p>Your team needs you to diagram and deploy a two-tier architecture for your company. For the Foundational project you are allowed to have all your code in a single main.tf file with hardcoded data.</p><p>Overview:</p><ol><li>Deploy a VPC with CIDR 10.0.0.0/16 with 2 public subnets with CIDR 10.0.1.0/24 and 10.0.2.0/24. Each public subnet should be in a different AZ for high availability.</li><li>Create 2 private subnet with CIDR ‘10.0.3.0/24’ and ‘10.0.4.0/24’ with an RDS MySQL instance (micro) in one of the subnets. Each private subnet should be in a different AZ.</li><li>A load balancer that will direct traffic to the public subnets.</li><li>Deploy 1 EC2 t2.micro instance in each public subnet.</li></ol><h3>What you’ll need:</h3><ul><li>You will need to create an AWS IAM user account with admin rights</li><li>An access key and a secret key</li><li>A source code editor. I prefer using Visual Studio Code or AWS Cloud9, but they must have Terraform and AWS CLI installed on them</li><li>GitHub account</li></ul><p>Step 1. Create <em>main.tf</em> file</p><p>Let’s create a new directory for our <em>main.tf </em>file. We’ll create a new directory using this commandmkdir &lt;directory_name&gt; . Then, we’ll cdcd &lt;directory_name&gt; into that directory and create the main.tf file. Open your source code editor, create, and name your new folder/directory.</p><pre>mkdir Terraform-2-Tier<br>cd Terraform-2-Tier</pre><p>Next, create the <em>main.tf</em> file</p><pre>touch main.tf</pre><pre>terraform {<br>  required_providers {<br>    aws = {<br>      source  = &quot;hashicorp/aws&quot;<br>      version = &quot;~&gt; 4.0&quot;<br>    }<br>  }<br>}<br><br># Configure the AWS Provider<br>provider &quot;aws&quot; {<br>  region = &quot;us-east-1&quot;<br>}</pre><p>2. Create the VPC, 2 Public Subnets, &amp; 2 Private Subnets</p><ul><li><em>VPC</em> with CIDR 10.0.0.0/16</li><li><em>2 Public Subnets</em> with CIDR 10.0.1.0/24 (us-east-1a) &amp; 10.0.2.0/24 (us-east-1b)</li><li><em>2 Private Subnets</em> with CIDR 10.0.3.0/24 (us-east-1a) and 10.0.4.0/24 (us-east-1b)</li></ul><pre>#create the vpc<br>resource &quot;aws_vpc&quot; &quot;Tier2-vpc&quot; {<br>  cidr_block           = &quot;10.0.0.0/16&quot;<br>  enable_dns_support   = &quot;true&quot; #gives you an internal domain name<br>  enable_dns_hostnames = &quot;true&quot; #gives you an internal host name<br>  instance_tenancy     = &quot;default&quot;<br><br>  tags = {<br>    Name = &quot;Tier2-vpc&quot;<br>  }<br>}<br><br>#create the public and private subnet<br><br>#for public subnet1<br>resource &quot;aws_subnet&quot; &quot;public_subnet1&quot; {<br>  vpc_id                  = aws_vpc.Tier2-vpc.id<br>  cidr_block              = &quot;10.0.1.0/24&quot;<br>  map_public_ip_on_launch = &quot;true&quot; //it makes this a public subnet<br>  availability_zone       = &quot;us-east-1a&quot;<br>  tags = {<br>    Name = &quot;public-subnet-1&quot;<br>  }<br>}<br><br>#for public subnet2<br>resource &quot;aws_subnet&quot; &quot;public_subnet2&quot; {<br>  vpc_id                  = aws_vpc.Tier2-vpc.id<br>  cidr_block              = &quot;10.0.2.0/24&quot;<br>  map_public_ip_on_launch = &quot;true&quot; //it makes this a public subnet<br>  availability_zone       = &quot;us-east-1b&quot;<br>  tags = {<br>    Name = &quot;public-subnet-2&quot;<br>  }<br>}</pre><p>3. Create the Internet Gateway, Route table, &amp; Route table Association</p><pre>#Internet Gateway<br>resource &quot;aws_internet_gateway&quot; &quot;igw&quot; {<br>  vpc_id = aws_vpc.Tier2-vpc.id<br><br>  tags = {<br>    Name = &quot;Tier2_internet_gateway&quot;<br>  }<br>}<br><br><br># Route Table for public subnet<br><br>resource &quot;aws_route_table&quot; &quot;RouteTablepublic&quot; {<br>  vpc_id = aws_vpc.Tier2-vpc.id<br><br>  route {<br>    cidr_block = &quot;0.0.0.0/0&quot;<br>    gateway_id = aws_internet_gateway.igw.id<br>  }<br>}<br><br><br>#Route table Association with Public Subnet 1<br>resource &quot;aws_route_table_association&quot; &quot;PublicRTassociation1&quot; {<br>  subnet_id      = aws_subnet.public_subnet1.id<br>  route_table_id = aws_route_table.RouteTablepublic.id<br>}<br><br><br>#Route table Association with Public Subnet 2<br>resource &quot;aws_route_table_association&quot; &quot;PublicRTassociation2&quot; {<br>  subnet_id      = aws_subnet.public_subnet2.id<br>  route_table_id = aws_route_table.RouteTablepublic.id<br>}</pre><p>4. Create Security Groups for the EC2, Application Load Balancer, &amp; RDS MySQL</p><pre>#create security Groups, we&#39;ll be creating for ec2, AlB, and RDS<br><br>#security group for ec2<br><br>resource &quot;aws_security_group&quot; &quot;Tier2_ec2_sg&quot; {<br>  name        = &quot;Tier2_ec2_sg&quot;<br>  description = &quot;security group for public access&quot;<br>  vpc_id      = aws_vpc.Tier2-vpc.id<br><br>  ingress {<br>    description = &quot;ssh access&quot;<br>    from_port   = 22<br>    to_port     = 22<br>    protocol    = &quot;tcp&quot;<br>    cidr_blocks = [&quot;0.0.0.0/0&quot;]<br><br>  }<br><br><br>  ingress {<br>    description = &quot;http access&quot;<br>    from_port   = 80<br>    to_port     = 80<br>    protocol    = &quot;tcp&quot;<br>    cidr_blocks = [&quot;0.0.0.0/0&quot;]<br><br>  }<br><br><br>  egress {<br>    from_port   = 0<br>    to_port     = 0<br>    protocol    = &quot;-1&quot;<br>    cidr_blocks = [&quot;0.0.0.0/0&quot;]<br>  }<br><br>  tags = {<br>    Name = &quot;ec2 security group&quot;<br>  }<br>}<br><br><br>#Secrity group for load balancer<br>resource &quot;aws_security_group&quot; &quot;alb_sg&quot; {<br>  name        = &quot;Tier2_alb_sg&quot;<br>  description = &quot;security group for alb&quot;<br>  vpc_id      = aws_vpc.Tier2-vpc.id<br><br><br>  ingress {<br>    description = &quot;http access&quot;<br>    from_port   = 80<br>    to_port     = 80<br>    protocol    = &quot;tcp&quot;<br>    cidr_blocks = [&quot;0.0.0.0/0&quot;]<br><br>  }<br><br>  egress {<br>    from_port   = 0<br>    to_port     = 0<br>    protocol    = &quot;-1&quot;<br>    cidr_blocks = [&quot;0.0.0.0/0&quot;]<br>  }<br><br>  tags = {<br>    Name = &quot;alb security group&quot;<br>  }<br>}<br><br><br>#security group for RDS<br><br>resource &quot;aws_security_group&quot; &quot;Tier2_RDS_sg&quot; {<br>  name        = &quot;Tier2_RDS_sg&quot;<br>  description = &quot;security group for RDS&quot;<br>  vpc_id      = aws_vpc.Tier2-vpc.id<br><br>  ingress {<br>    description     = &quot;RDS access&quot;<br>    from_port       = 3306<br>    to_port         = 3306<br>    protocol        = &quot;tcp&quot;<br>    security_groups = [aws_security_group.Tier2_ec2_sg.id]<br>    cidr_blocks     = [&quot;0.0.0.0/0&quot;]<br><br>  }<br><br><br>  egress {<br>    from_port   = 0<br>    to_port     = 0<br>    protocol    = &quot;-1&quot;<br>    cidr_blocks = [&quot;0.0.0.0/0&quot;]<br>  }<br><br>  tags = {<br>    Name = &quot;RDS security group&quot;<br>  }<br>}</pre><p>Create an EC2 instance for the 2 subnets (public).</p><pre>#create ec2 for each public subnet.<br># for public subnet 1<br>resource &quot;aws_instance&quot; &quot;ec2_instance_public_1&quot; {<br>  ami             = &quot;ami-026b57f3c383c2eec&quot;<br>  instance_type   = &quot;t2.micro&quot;<br>  subnet_id       = aws_subnet.public_subnet1.id<br>  security_groups = [aws_security_group.Tier2_ec2_sg.id]<br>}<br><br># for public subnet 2<br>resource &quot;aws_instance&quot; &quot;ec2_instance_public_2&quot; {<br>  ami             = &quot;ami-026b57f3c383c2eec&quot;<br>  instance_type   = &quot;t2.micro&quot;<br>  subnet_id       = aws_subnet.public_subnet2.id<br>  security_groups = [aws_security_group.Tier2_ec2_sg.id]<br>}</pre><p>Now, we’ll create the Application Load Balancer</p><pre>#create the application load balancer<br><br>resource &quot;aws_lb&quot; &quot;Tier2_alb&quot; {<br>  name               = &quot;Tier2-alb&quot;<br>  internal           = false<br>  load_balancer_type = &quot;application&quot;<br>  subnets            = [aws_subnet.public_subnet1.id, aws_subnet.public_subnet2.id]<br>  security_groups    = [aws_security_group.alb_sg.id]<br><br>  enable_deletion_protection = false<br><br>  tags = {<br>    Environment = &quot;Tier2_alb&quot;<br>  }<br>}<br><br><br>#create alb target group<br><br>resource &quot;aws_lb_target_group&quot; &quot;Tier2-TG&quot; {<br>  name        = &quot;Tier2-lb-tg&quot;<br>  port        = 80<br>  protocol    = &quot;HTTP&quot;<br>  target_type = &quot;instance&quot;<br>  vpc_id      = aws_vpc.Tier2-vpc.id<br>  health_check {<br>    interval            = 90<br>    enabled             = true<br>    path                = &quot;/&quot;<br>    matcher             = 200<br>    timeout             = 60<br>    protocol            = &quot;HTTP&quot;<br>    healthy_threshold   = 3<br>    unhealthy_threshold = 2<br>  }<br><br>}<br><br>#create alb listener<br>resource &quot;aws_lb_listener&quot; &quot;Tier2_alb_listener&quot; {<br>  load_balancer_arn = aws_lb.Tier2_alb.arn<br>  port              = &quot;80&quot;<br>  protocol          = &quot;HTTP&quot;<br>  default_action {<br>    type             = &quot;forward&quot;<br>    target_group_arn = aws_lb_target_group.Tier2-TG.arn<br>  }<br>}<br><br><br>#create alb target group attachment<br><br>resource &quot;aws_lb_target_group_attachment&quot; &quot;ec2_instance_public_1&quot; {<br>  target_group_arn = aws_lb_target_group.Tier2-TG.arn<br>  target_id        = aws_instance.ec2_instance_public_1.id<br>}<br><br><br>resource &quot;aws_lb_target_group_attachment&quot; &quot;ec2_instance_public_2&quot; {<br>  target_group_arn = aws_lb_target_group.Tier2-TG.arn<br>  target_id        = aws_instance.ec2_instance_public_2.id</pre><p>Create the RDS MySQL</p><pre>#create db_instance subnet group<br><br>resource &quot;aws_db_subnet_group&quot; &quot;db_instance&quot; {<br>  name       = &quot;db_instance&quot;<br>  subnet_ids = [aws_subnet.privatesubnet1.id, aws_subnet.privatesubnet2.id]<br><br>  tags = {<br>    Name = &quot; DB subnets&quot;<br>  }<br>}<br><br><br>#create DB instance<br><br>resource &quot;aws_db_instance&quot; &quot;tierdb&quot; {<br>  allocated_storage    = 10<br>  db_name              = &quot;mydb&quot;<br>  engine               = &quot;mysql&quot;<br>  engine_version       = &quot;5.7&quot;<br>  instance_class       = &quot;db.t2.micro&quot;<br>  username             = &quot;admin&quot;<br>  password             = &quot;password&quot;<br>  parameter_group_name = &quot;default.mysql5.7&quot;<br>  vpc_security_group_ids = [aws_security_group.Tier2_RDS_sg.id]<br>  db_subnet_group_name = &quot;db_instance&quot;<br>  skip_final_snapshot  = true<br>}</pre><p>5. Terraform Init, Plan, &amp; Validate</p><p>After you’ve created the above files, we then need to initialize the terraform backend by using the command terraform init</p><p>If the directory has been initialized successfully, it should yield this result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*LnuMMi5pMUAXPSPRuj_lAA.png" /></figure><p>We will run the terraform plan terraform apply terraform validate commands to evaluate the Terraform configuration, to apply the configuration, and validate the configuration files.</p><p>terraform plan :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*h4AJ2KyIluh-x3lQLhvCIQ.png" /></figure><p>terraform validate :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*bp7fTnKrbQiJt-LqAZJt-A.png" /></figure><p>Run the command terraform apply to apply the configuration. If you get an “Apply complete!” message, then you’ve successfully deployed a two-tier architecture.</p><p><strong>6. Terraform Destroy</strong></p><p>Destroy everything you’ve created with this command:</p><pre>terraform destroy</pre><p>Thank you for reading my article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5639f90a1f41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using an API gateway to trigger Lambda and send a message through SQS]]></title>
            <link>https://medium.com/@janelle_williams/using-an-api-gateway-to-trigger-lambda-and-send-a-message-through-sqs-4970070ce61b?source=rss-120573f1c241------2</link>
            <guid isPermaLink="false">https://medium.com/p/4970070ce61b</guid>
            <dc:creator><![CDATA[Janelle Williams]]></dc:creator>
            <pubDate>Sun, 23 Oct 2022 10:43:17 GMT</pubDate>
            <atom:updated>2022-10-23T21:00:46.416Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*J8A1VeQ_VjhN1_ei.png" /></figure><p>Today we’re going to be setting up a lambda function to be triggered and send a message to SQS.</p><p>You will need the following:</p><ul><li>An AWS account with the necessary permissions</li><li>Boto3 installed</li><li>Cloud 9</li></ul><p>Step 1: The SQS queue</p><p>In Cloud 9, create an SQS queue using a python script. I borrowed this <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/guide/sqs.html">code</a>. If you choose to use this code, just add ‘import boto3&#39; to the script</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*pAwUvtEB9KHUcLAjdQ4kQA.png" /></figure><p>Run this code to create your SQS queue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*xvJn1rRJHQbzN1sr1_F3Sg.png" /></figure><p>Step 3. Lambda</p><p>Go to the Lambda dashboard in AWS. Select “Create function.” Keep “Author from scratch” as your option, and select a runtime of python 3.7 or 3.8.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*XEuTF62p2bKHL7_7YQ1YgA.png" /></figure><p>Now, create your function.</p><p>Step 3: Adding the Lambda trigger</p><p>From the Lambda dashboard, we’ll select “Add trigger →API Gateway → Create a new API →HTTP API, with “Open” security. Then add the trigger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/0*UUFcrEpGTongOjtU.png" /></figure><p>Step 4. Permissions</p><p>Now we want to update our permissions. Go to the Configuration tab and then to Permissions. Select your role and click on the plus arrow next to your role name. Click on the role name → select Add Permissions<strong> </strong>→ search SQS and attach<strong> </strong>full access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*rtpk322bnX8QARMtQsQTNg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*KELK8IvMPaEO9NYu5QliMA.png" /></figure><p>We now have our Lambda execution role set up.</p><p>Step 5: Modify the Lambda to send a message to the SQS queue.</p><p>In your Lambda dashboard, select Code<strong> → </strong>add the following code to your function (add your own URL) <strong>→</strong>Deploy<strong> → </strong>Test <strong>→ </strong>Your results should look something like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*In8z2ek50qq8pZiWJ6kguA.png" /></figure><p>NOTE: You’ll have to change the URL to match your personal information. You can get your SQS queue URL from your Cloud9 where we ran our code earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*AoBV8e1CsEkiDoRBDwrZKA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*gbdInIzp7iRESGASyITFLg.png" /></figure><p>Step 6: Testing</p><p>Select Test to create a test. Name your test. Keep your Event sharing as Private. Under template, select apigateway-aws-proxy. Click save.</p><p>Click on the test button. You will get a status code of 200 if you’ve done everything correctly.</p><p>Now let’s go to SQS to make sure we received the message. From the SQS dashboard →click on our function →Send and receive messages →Poll for messages (at the very bottom of the page)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*cFg_C2aLq8tXFpQWYQAHuw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/195/1*uaubfwTf3htcc5s_MNqkIw.png" /></figure><p>If everything works correctly, you will see the current date and time!</p><p>Thank you for reading my article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4970070ce61b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python, DynamoDB: Scan, Query, Add, & Delete Items — Part 2]]></title>
            <link>https://medium.com/@janelle_williams/python-dynamodb-scan-query-add-delete-items-part-2-e90601efca60?source=rss-120573f1c241------2</link>
            <guid isPermaLink="false">https://medium.com/p/e90601efca60</guid>
            <dc:creator><![CDATA[Janelle Williams]]></dc:creator>
            <pubDate>Sun, 23 Oct 2022 06:41:16 GMT</pubDate>
            <atom:updated>2022-10-23T06:41:16.123Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python, DynamoDB: Scan, Query, Add, &amp; Delete Items — Part 2</h3><p>We recently built a DynamoDB table. Let’s add an item, delete items, scan it, and run a query.</p><p>If you’d like to read part 1 of this article showing you how to create a DynamoDB table, you can find it <a href="https://medium.com/@janelle_williams/using-python-and-cloud-9-to-create-add-items-to-a-dynamodb-table-292469e7b630">here</a>.</p><p>What you’ll need:</p><ul><li>AWS account with permissions to access the Cloud9 and DynamoDB services</li></ul><p>1. Adding Items</p><p>Once your Cloud9 environment and DynamoDB have been created, let’s add information to the table. To add items you can use a script like <a href="https://github.com/darcyjwood/Python_Catch_All/blob/main/dynamodb-boto3-insert-item.py">this</a> which I got from a cohort:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*8Jqlb5DyBSDryanAMxYIRw.png" /></figure><p>I’ve added 3 items to my table. If you go to the DynamoDB dashboard then click on Tables, you’ll see the table you just created. Click on it to view your items.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*TNXg96A4RgJkXQ1HDhVtdA.png" /></figure><p>2. Scan Items</p><p>Using Python, you can also scan the table via Cloud9 to see the items in your table. I got this script from a cohort. You can find the same script <a href="https://github.com/darcyjwood/Python_Catch_All/blob/DynamoDB/dynamoscan.py">here</a>, but remember to replace my table name with your own. Name and save your new file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*4nxpIHL6ZQC8P18Ufdss0A.png" /></figure><p>Run the scan by putting the name of the script we just created, in the command line. Once you run the scan, you can see all of the items that are listed in my DynamoDB Table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*iVkpNR8Xbr044rmmPV8tlg.png" /></figure><p>3. Delete Items</p><p>If you’d like to delete an item from your table, this is the script I <a href="https://github.com/darcyjwood/Python_Catch_All/blob/DynamoDB/dynamodeleteitem.py">used</a>. Tailor the script with your information and then save the info.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*yGhL8MTx_qEVfMGCRkxFNA.png" /></figure><p>When I view my DynamoDB table now, I went from having 6 items to having 5. My delete worked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*_wWWebl2txRVZ-i4eqOG9w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*uO9FXcPIW5_LWbbecIW0Aw.png" /></figure><p>Query Table</p><p>If you’d like to query your table for something specific, you can use this <a href="https://github.com/darcyjwood/Python_Catch_All/blob/DynamoDB/dynamoquery.py">script</a>; just edit the code with your information.</p><p>I edited the code with my information. When I ran the code, it gave me pricing information for a specific item. I asked, “How much is a flight to Panama?” As I only wanted pricing info for that particular item.</p><p>Thank you for reading my article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e90601efca60" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Python and Cloud 9 to create & add items to a DynamoDB Table]]></title>
            <link>https://medium.com/@janelle_williams/using-python-and-cloud-9-to-create-add-items-to-a-dynamodb-table-292469e7b630?source=rss-120573f1c241------2</link>
            <guid isPermaLink="false">https://medium.com/p/292469e7b630</guid>
            <dc:creator><![CDATA[Janelle Williams]]></dc:creator>
            <pubDate>Sun, 23 Oct 2022 04:11:24 GMT</pubDate>
            <atom:updated>2022-10-23T21:15:28.439Z</atom:updated>
            <content:encoded><![CDATA[<p>What you’ll need</p><ul><li>AWS account with the right permissions to access the Cloud9 and DynamoDB services</li></ul><p>STEP 1. Create an Environment in Cloud 9</p><p>In AWS, search for the Cloud9 service in the search bar. Click on Create Environment, name the environment, give it a description (this step is optional), and click on Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*ZfZxh2SF80rkRS_xD4g7nQ.png" /></figure><p>Leave all the other settings on the next page as is, and click on Next step. Then, click on Create environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/0*l43014r-CNNIjb2P.png" /></figure><p>It will take a few minutes for your environment to be created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*nyeZkXOUmZu7lHcLMmYnMQ.png" /></figure><p>Step 2. Install Boto3</p><p>We’ll be using Python scripts to create our table and add items to it. In order to accomplish this, we’ll need to install Boto3.</p><p>To install Boto3 on Cloud 9, we will use the following command:</p><p>pip install boto3</p><p>You’ll know it’s been successfully installed because it will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*tZC3jrhZhdysnaXHtrwrbA.png" /></figure><p>Step 2. Create Database</p><p>We can create a database now that Boto3 is installed. First, let’s create a file. Click on File, →New From Template →Python file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/0*JTjV3h1Xg8lR2QnV.png" /></figure><p>After our file has been created, we are able to write our code. In this code, we will give our database a table name, and add both the partition key and the sort key. We will also include our read and write capacity units.</p><p>The partition key will be a Hash key type. The sort key will be a Range key type. The partition key and the sort key, make up the composite primary key. All items with the same partition key value are stored together, by the sort key value.</p><p>Here is the code I used to create a database in DynamoDB. I’m making a database for my dream vacation destinations (places I dream of traveling to and the cost to travel there). My “Special” attribute is a string so it will be indicated by an “S.” My “Price” attribute is a number so it will be indicated with an “N”.</p><p>I forked a repo from a cohort and edited the code. If you’d like to copy the code, you can find it <a href="https://github.com/janellewill/Python_DynamoDb">here</a>. You’ll just need to edit your TableName, AttributeNames, and AttributeTypes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*ebxs8etqnPH2uuceRPTE6Q.png" /></figure><p>After your code has been created, go to File →Save As, and name your file. Since we are using Python, use <em>.py</em> as the extension to your file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*nkPO0yLaMr_ZHyc-YXfs1Q.png" /></figure><p>In our terminal at the bottom of the screen, we’ll type a command to run our file and set up the table. When you run your command, use your file name in place of mine:</p><p>python Dream_Vacation.py</p><p>Now, let’s go to DynamoDB services to view the table we’ve just created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*edoOgCjx7O5ccM9AdU9h1g.png" /></figure><p>Let’s add items to our database.</p><p>Step 4. Adding items to the database</p><p>Let’s go back to Cloud9. We’ll make another file that will write items to our newly created database. Here is the code I used that will add in both the partition and the sort key for one item.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*5oDAm3ZOnFCuIV0hD14ELw.png" /></figure><p>After you save your file, run this code in the terminal but be sure to replace it with your file name:</p><p>python DB-Boto3-InsertItem.py</p><p>After we run this command and everything is successful, let’s go over to DynamoDB. Select your table by checking the box to the left of its name, selecting Actions, and from the drop-down menu, select Explore Items.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*d4kHX5_6Twr9aH8aiC9MfA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*yUi296lMOBzr613SnUUmfg.png" /></figure><p>Mission accomplished. We used Cloud 9 and Python scripts to create &amp; add items to a DynamoDB Table.</p><p>Thank you for reading my article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=292469e7b630" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Autoscaling Group & Application Load Balancer in a Custom VPC with 3 Public Subnets to…]]></title>
            <link>https://medium.com/@janelle_williams/deploying-autoscaling-group-application-load-balancer-in-a-custom-vpc-with-3-public-subnets-to-3c97d236dadf?source=rss-120573f1c241------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c97d236dadf</guid>
            <dc:creator><![CDATA[Janelle Williams]]></dc:creator>
            <pubDate>Sat, 22 Oct 2022 18:41:13 GMT</pubDate>
            <atom:updated>2022-10-24T02:16:39.644Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploying Autoscaling Group &amp; Application Load Balancer in a Custom VPC with 3 Public Subnets to make the Application Highly Available</h3><ol><li><strong>Log in to AWS</strong></li><li>Search for VPC in the search bar or select VPC dashboard on the left side of the page</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*Pnd0ejFmxLGY3OZi69UM_w.png" /></figure><p>3. Select ‘Create VPC’<br>4. Select ‘VPC and more options’ to create the VPC &amp; add 3 Subnets in different availability zones, simultaneously. Name the VPC and provide the IPv4 CIDR block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*jrdhTOLIik-0tuwSuC59iA.png" /></figure><p>5. Select 3 availability zones, 3 public subnets, and 0 private subnets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*2nE435eBiDTmPQbar3JL1A.png" /></figure><p>6. Select ‘Customize subnet CIDR blocks,’ as shown above. By doing this, we have the option to give our Public Subnets the IP addresses that we want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*tZiix-JFC8dHKLRS.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/0*6zzt9nOFwExdzMmP.png" /></figure><p>You can keep the default answers for the rest of the options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*kG6SK5JoIK3xkNiJ07kaUA.png" /></figure><p>7. Select, ‘Create VPC.’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*c7Rcbdze6FwsapsK7qXIpA.png" /></figure><p>Once the VPC is created, let’s go into each of the public subnets by going to Actions -&gt; Edit Subnet Settings -&gt; Assign Auto IP Address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*cUOsFdS1lSbIujUAmDqFJw.png" /></figure><p>Check the box next to ‘Enable Auto-Assign Public IPv4 address’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*6uo0ZUcJhhctfgsz.png" /></figure><p>Now create to EC2 template by going to EC2 &gt; Instances &gt; Launch Templates</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/0*P84JEInaRpIfon2Z.png" /></figure><p>Select, ‘Create a Launch Template’ in the top right corner of the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*5wKb3iq03ptBe1f7BVJvvQ.png" /></figure><p>Let’s use Amazon Linux AMI to create an EC2 t2.micro instance and insert the Apache installation script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*ibq-U7kKQe5SFXA6OYm00w.png" /></figure><p><strong>Creating the Auto Scaling Group</strong></p><p>8. Now, it’s time to create the ASG. Go to the search bar and type Auto Scaling Groups and select it from the drop down menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*E5RhYJG5iDm4yAWh8vRz5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*uu76fgJ8G1U7G955QAy5ug.png" /></figure><p>9. Select Create Auto Scaling Group</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*0GfOhYGHDUVAB-ehoXgbuQ.png" /></figure><p>10. Name your Auto Scaling Group. In the <strong>Launch Template</strong> section, select the launch template that automatically populates in the drop down menu. For me it was called, ‘AutoScaling.’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*qB58sQHMe4n4YNDE31TefQ.png" /></figure><p>11. Select, “C<strong>reate a launch template.”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*bT0abdD1N5n1HXwXeufWTA.png" /></figure><p>12. From the launch options menu, select the new VPC and the three public subnets that we just created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*X0Iim0e34CQymrQYEEtFJA.png" /></figure><p>13. Click on Auto scaling (it has the arrow in a box right next to it)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*rznl8RsqLbfdLmY4nIsxJQ.png" /></figure><p>14. Select the <strong>Launch Template</strong> option. Select the template you want to launch, then click on Create Launch Template</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*tN42JIFKc96p0hQk6EbUmA.png" /></figure><p>15. Name your launch template, include a description, and select that you want to be provided guidance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*E5RhYJG5iDm4yAWh8vRz5g.png" /></figure><p>16. Select Amazon Linux 2 AMI as it is Free tier eligible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*NfgGB-If4ezT1F87hczFpA.png" /></figure><p>17. Select t.2 micro as your instance type. You should also use a key pair to log into your EC2 if needed. I will use a key pair that I’ve previously used before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*pa0uAzTl93NvO2n9yN7BdQ.png" /></figure><p>18. Create security group, name your security group, add a description, and select the new custom VPC that was just created earlier</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*wDz_clIGHghODgaN_cd6Qg.png" /></figure><p>19. We need to configure rules for the new security group. We need to add two inbound security group rules:</p><ol><li>One is for the SSH on port 22 (allows you to securely connect to your instances)</li><li>The other is for HTTP on port 80 (connects to the public IP of your EC2)</li></ol><p>Be sure to choose <strong>My IP</strong> for the Source type for SSH so your IP address will be allowed to SSH into your EC2s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*EizrRfJzi5wj6bsax00kDQ.png" /></figure><p>20. We need to add a network interface and auto-assign a public IP address. To do so, open the <strong>Advanced network configuration</strong> tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*_ePEh7ux-7ftV849Sg7BXg.png" /></figure><p>21. Scroll to Advanced details. Here, we’ll add a<strong> </strong>bash script to the template.</p><p>I entered this script into the <em>User data </em>field:</p><pre>#!/bin/bash<br>yum update -y<br>yum install -y httpd<br>systemctl start httpd service<br>systemctl enable httpd service<br>firewall -cmd — permanent — zone=public — add-service=http<br>firewall -cmd — reload</pre><p>22. Let’s go back to the EC2 menu so we can create an Application Load Balancer. An Application Load Balancer helps distribute web traffic to our EC2s. Select Load Balances, and then click <strong>Create Load Balancer</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/181/1*xMYzIDTAg8lF5GQV8paeow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/1*V3RzWZSltaDMegTGKMfsGg.png" /></figure><p>23. Select the balancer type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/181/1*0h04qVtRoTOWjji9lSphJQ.png" /></figure><p>24. Name your ALB and select <strong>Internet-facing</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*4OWYxndAN1-WeEamEPlWtg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*OBXWCJGIZ2KO3NPV.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*ekux2NNHnOykwFDT.png" /><figcaption>Just click next</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*2vR2lJFmTtCecuhA.png" /><figcaption>Just click next</figcaption></figure><p>We’re almost done. After you hit next and have gone through all of the prompts, you will get a confirmation message stating that your load balancer, target group, and listener were created successfully, and 1 new target group has been attached to the ASG. Click on Create an Auto Scaling Group:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*r5QvZOFgU2chBuJbOmrjXQ.png" /></figure><p>The final step is to check our public IPv4 to see if we can successfully connect:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*zCzw_o4YczWNmYb9.png" /></figure><p>Thank you for reading my article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c97d236dadf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create an AWS EC2 Instance with Apache Installed Using a BASH script]]></title>
            <link>https://medium.com/@janelle_williams/how-to-create-an-aws-ec2-instance-with-apache-installed-using-a-bash-script-e703c0be02b0?source=rss-120573f1c241------2</link>
            <guid isPermaLink="false">https://medium.com/p/e703c0be02b0</guid>
            <dc:creator><![CDATA[Janelle Williams]]></dc:creator>
            <pubDate>Sat, 22 Oct 2022 18:25:09 GMT</pubDate>
            <atom:updated>2022-10-22T18:28:50.953Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*dTnAbyhEyGRvQtFs8jUoAw.png" /></figure><p>Why would we even need to know this?</p><p>Picture this…</p><p>Your company wants to start shifting from using on premises servers to using servers in the cloud. Rather than purchasing all of the infrastructure in a data center they ask you to create an EC2 instance in AWS to host their new website.</p><ol><li>Log in to Amazon Web Services and go to the VPC Dashboard. Click on, “Create VPC.”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*pJndFrHRHUoQVuINOB2lYg.png" /></figure><p>2. Configure your VPC settings. Create a name tag for your VPC:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*qvq-rpNFxkXDrNY_DNXsCw.png" /></figure><p>Click on ‘Create VPC.’</p><p>3. Now, create a subnet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*oWJAJhcqO6SzgAJ16SSFWw.png" /></figure><p>4. For the VPC ID, select the VPC that we named and created in step 2, from the drop down menu:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*iLBUrc6Wh_sP4ma8wW8SZg.png" /></figure><p>5. Configure your Subnet settings, then click on Create Subnet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*DmJkNwxRdgwxZ8iffRxhZw.png" /></figure><p>6. Create an Internet Gateway to attach to your VPC. In the navigation pane on the left side of the screen, <strong><em>select Subnets.</em></strong></p><p><strong><em>Select the subnet we just created. Go to the Route table tab, make sure there’s a route with 0.0.0.0/0 as the destination, and the internet gateway for our VPC as the target. — I need to figure out how to set that as a destination-it might be under the NETWORK ACL tab instead</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*zqpC8ORv8IJF-PJcukYAOQ.png" /></figure><p>7. Create a server by going to your EC2 Dashboard and selecting, Launch Instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*Bxjz3Mr_UMYEINCrlBNlqQ.png" /></figure><p>8. Name your Server.</p><p>Choose your Free Tier Eligible AMI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*xKBPrusLFODOKzKZxOG6eA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*FRvwx_LbEwEgzHfsTlsCeA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*KArUZmhH_KmKHCvfdZz_dg.png" /><figcaption>Select your key pair from the drop down menu if you already have one. I chose to create a new key pair for this.</figcaption></figure><p>9. Next, let’s configure our Security Group to allow inbound traffic on HTTP for 0.0.0.0/0, and allow inbound traffic on SSH from our IP address. This will only allow us to log into our server while everyone else can visit the webpage.</p><p>In Network Settings, click on ‘Edit’ to customize your settings. Be sure to select your VPC, the Subnet we just created, and your Key Pair.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*H3S9wvZepKt8oQlzFIKulA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*L4sxMas4c_8EL-9F85L6BQ.png" /></figure><p>It’s time to launch our instance. Here’s the instance we just launched:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*kux9ahL3tzGMO6Gjd0kbMw.png" /></figure><p>Step 10: Convert to a Web Server</p><p>Now, let’s create our script to install our Apache server!</p><pre>vim userscript.sh</pre><p>Enter the following script:</p><pre>#!/bin/bash<br>yum update -y<br>yum install httpd -y<br>systemctl start httpd<br>systemctl enable httpd</pre><p>Hit the ‘esc’ key and then type :wq to save and exit vim.</p><p>Let’s test our IP address in a new tab to see if everything worked. Click on your instance, copy your public IPv4 address, and paste in a web browser to get your website. Your results should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*zCzw_o4YczWNmYb9.png" /></figure><p>Thank you for reading my article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e703c0be02b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning the Basics of Github]]></title>
            <link>https://medium.com/@janelle_williams/next-i-created-the-fork-notice-im-creating-it-in-my-personal-account-4bd2b2210044?source=rss-120573f1c241------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bd2b2210044</guid>
            <dc:creator><![CDATA[Janelle Williams]]></dc:creator>
            <pubDate>Sat, 22 Oct 2022 16:50:13 GMT</pubDate>
            <atom:updated>2022-10-22T16:51:12.633Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/123/1*ytFXDLjzvvDC9FYIw4P1rQ.png" /></figure><p>What is GitHub?</p><p>GitHub is a cloud-based hosting service that enables you to work together with others on projects from anywhere. It’s used to store, track, and allow multiple developers to collaborate on software projects. In this article we’ll go over how to fork a repo, clone, push, and pull requests.</p><p>What you’ll need:</p><ul><li>GitHub account</li><li>Personal access token. Find information <a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-token">here</a> on how to create a token.</li><li>A Command Line Interface (CLI)</li><li>Git installed and configured on your Command Line Interface</li><li>A repository in your server</li></ul><h3>Github: Fork, Edit, Push, Pull</h3><p>Step 1: Fork</p><p>Once you’ve logged into your server, go to GitHub and find the repository you’d like to fork. The fork option is in the top right corner of your screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*gusJDxRBm1DPsfRTnI3i9w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*lIbsH8x-MF312yTkmpOrng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*Xv-NOGV0NxkuldoduE9ygg.png" /></figure><figure><img alt="Once you click on Fork in the top right corner of the screen, you will be taken to this page" src="https://cdn-images-1.medium.com/max/600/1*WpkAl0mWZOHG-hfbTyEsfA.png" /><figcaption>I created the Fork. Notice that I’m creating it in my personal account.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*xd3cyNoQmorkMpKQ4LW-zw.png" /></figure><p>Now that you’ve successfully made a fork of the repo, it’s time to clone.</p><p>Step 2. Clone</p><p>Copy the HTTPS link from the repo. Click on the code button and it will populate in the drop down menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*WLQ8Bc7h2itkJTM6GZekrA.png" /></figure><p>Once you have copied the URL, go to your CLI and use the git clone command and paste the URL you copied and the directory you want it cloned into.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*nH4ZygW8_pD8QF0YaXADdA.png" /></figure><p>It should ultimately look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*0fmyGUOg-sJiSuBjq1PiAg.png" /></figure><p>Step 3. Edit</p><p>So far, you’ve successfully cloned the forked repo. Now, let’s edit or make changes to the repo. First we need to change directories.</p><pre>cd levelupteamrepo</pre><p>Now, let’s see what files are in the repo that we can edit.</p><pre>ls -a</pre><p>You’ll be shown the available files. Choose which one you’d like to edit. Let’s edit the linux.sh file. Then, Vim the file:</p><pre>vim linux.sh</pre><p>To make changes to the file, press the ‘esc’ key on your keyboard then type, ‘:wq’ to save the change. My bash file looks like this. I made an edit by adding an echo with a variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*TbTzSQsgEkxOhu2kwPRWYQ.png" /></figure><p>To see if the script runs correctly use bash command:</p><pre>bash linux.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*vsCISRqybGT2CkXAHgk_Hw.png" /></figure><p>Everything looks good.</p><p>Step 4: Committing changes</p><p>Next, check the status of git by using the following command:</p><pre>git status</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*tk9mmKOmUJH4JT9GrQrGLQ.png" /></figure><p>Git tells us what we need to do next. Let’s add the modified file and commit the changes using the following command:</p><pre>git add linux.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*Ythe-_YOJIsMUlo4TBVc5w.png" /></figure><p>You’ll need to write text with your commit explaining why you made a change.</p><pre>git commit -m &quot;Added This is week 4 - project test! message&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*vJpSKqZfbnr8zbJCNGZzhQ.png" /></figure><p>If we check the status again, we’ll see that the working directory is clean</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*3EUEELy0OvIbhlKtDweh5g.png" /></figure><p>Step 5: Pushing the file back to your own repo</p><p>Now we’re ready to push our changed file back into our own repo in GitHub. Use this command:</p><p>git push -u origin main</p><p>It will prompt you to enter your GitHub username and password. The password will be your personal access token from Github.</p><p>When you go back to Github, you should now see your commit was pushed to the website.</p><p>Step 6. Pull request</p><p>Go back to your profile on Git Hub. In your repo click on “Pull Requests” and create a new pull request. This will take you to the original repo.</p><p>Here, you’ll also see the file you edited and the changes you are suggesting to the owner of the original repo. You have the option to comment about why your request should merge with the repo (the owner can choose to approve or deny your request). Then click, ‘Create Pull Request.’</p><p>We’ve successfully forked a repo, cloned that fork, made changes to your specific file, pushed it back to your own repo in GitHub, and created a pull request!</p><p>Thanks for reading my article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bd2b2210044" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Working with AWS CodePipeline (CI/CD)]]></title>
            <link>https://medium.com/@janelle_williams/working-with-codepipeline-in-aws-ci-cd-292369d2fabd?source=rss-120573f1c241------2</link>
            <guid isPermaLink="false">https://medium.com/p/292369d2fabd</guid>
            <dc:creator><![CDATA[Janelle Williams]]></dc:creator>
            <pubDate>Sat, 22 Oct 2022 04:52:11 GMT</pubDate>
            <atom:updated>2022-10-24T02:24:47.528Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*zAe6mB26kXU1UWrYZ9vpWQ.png" /></figure><p>We’ll be using AWS to build a pipeline for CI/CD.</p><h4>What we’ll need:</h4><ul><li>An AWS account</li><li>GitHub account</li><li>I forked a repo from a cohort. All of the code I’ll be using can be found <a href="https://github.com/janellewill/LUIT-CI-CD-proj">here</a>. Feel free to use it as well.</li></ul><p>Step 1: Create and Configure an S3 Bucket to host a static website</p><p>In AWS search for S3, then select Buckets, then select Create Bucket</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*HVtBJCuUcmU4tROBoveElA.png" /></figure><p>Name your bucket and choose your region</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*SjvYkrc_bo3xarGiT9VI9Q.png" /></figure><p>Uncheck<em> </em>Block all public access</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*AiJwD1wst56leC6LmcWGsw.png" /></figure><p>Click Create bucket. Once the bucket is created, go into the bucket and click on the Properties tab. This is where we’ll configure it to host a static website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*O_FdOrS-eLmcRCd8clGUOg.png" /></figure><p>Scroll all the way down to the bottom of the page until you see Static Website Hosting and then click on Edit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*VHHyIIS5k78_fI_ljcWr5g.png" /></figure><p>Enable static website hosting. Then type index.html in the Index Document section, and error.html in the Error Document section. Click Save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*YPJ7vGcRF_QYv1hT3QCtoQ.png" /></figure><p>Now, we’ll head over to the Permissions tab where we’ll add a bucket policy to allow public read access. Click on Edit bucket policy and paste the JSON code below, just be sure to replace your bucket name in the resource section along with /* (be sure to change the ARN to your bucket name with “/*” after the ARN). Click Save.</p><pre>{<br> “Version”: “2012–10–17”,<br> “Id”: “Policy1653853839796”,<br> “Statement”: [<br> {<br> “Sid”: “Stmt1653853838629”,<br> “Effect”: “Allow”,<br> “Principal”: “*”,<br> “Action”: “s3:GetObject”,<br> “Resource”: “arn:aws:s3:::mycicd-bucket/*”<br> }<br> ]<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*qcLu3X5d6OvLcQWUFregOg.png" /></figure><p>Your bucket is now publicly accessible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*BN_jJ0e6DgZCqeH5H1MUtw.png" /></figure><p>Once our S3 bucket is set up we can set up our pipeline.</p><p>Step 2. CodePipeline</p><p>Go to AWS CodePipeline → Create Pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*p20XK8pkUL1F6hWVVy5_Jw.png" /></figure><p>Name your pipeline, leave everything else with the default answers, and click <em>Next</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*3HdKdjArgwZseg39wk_q6g.png" /></figure><p>After hitting next, on the Add Source Stage, we’ll be prompted to select a source provider. You will want to choose GitHub (Version 2) and connect to your GitHub account. You will be asked to enter your GitHub account username and password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*4Y3oApfRwK-ehrBL.png" /></figure><p>We’ll then click on “Connect to GitHub”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*h9fjjFkCfIWME2tzreBSDw.png" /></figure><p>It will open up a new tab that looks like this. Create a name for your connection and click on Connect to GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*hTl5_4vt5Er2VaDkmm5SdQ.png" /></figure><p>Authorize your connector for GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*n_bp6wrPhH3IOT5iVApoOQ.png" /></figure><p>On the next page select “Install a new app”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*nCxSBpFLy2lEo7qPDndiAw.png" /></figure><p>You will then be asked which repositories AWS can connect to. Choose the repo you would like to install, and click Install → Connect.</p><p>On this page select the Repo you would like to install, then click “Install”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*DfGDfg176te_j_wO_pCyPg.png" /></figure><p>After entering your password, click on Connect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*lBZdGq1qGKDPCCWGwGppkQ.png" /></figure><p>If we’ve done things right, it should yield this result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*jx8laOJu58RPZOdSnbGCSg.png" /></figure><p>You will be brought back to CodePipeline. Here you will add your repository and branch name, and leave the other default settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*vx3T9DaJbLbpOpALjei03Q.png" /></figure><p>Click on Next.</p><p>Step 3. CodeBuild</p><p>Next, we’re going to use AWS CodeBuild. Choose your Region and select create a project, which will bring you to CodeBuild.</p><p>Give the project a name and description (if you’d like to), and configure the rest of the settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*D_KhzWWNWOpGBTkiSu21og.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*LeH9qB30SCE0cfKnbf43_Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*1EOIvI4MVFrW7GIf-7nFiQ.png" /></figure><p>We can leave the default settings for the rest. Select Continue to CodePipeline</p><p>Your screen should look like this now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*aE3N9zQRTXZRPX8q3aHnnw.png" /></figure><p>Click on Next.</p><p>Step 4. Deployment</p><p>Deploy to the S3 bucket you’ve just created. Choose Amazon S3 as your provider and the bucket we created earlier for this pipeline. Also, check the box next to “Extract file before deploy.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*0XOm3avXz5MQV0Z3snnDpA.png" /></figure><p>Click Next to review your pipeline. If everything looks good then click on Create pipeline. When it is done deploying your screen should look like this. There should be a success message at the top of the page, and the Source, Build, and Deploy stages will say, “Succeeded.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*rLkPXi_UaQ4gIOw8wVq89w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*QZ-GZLlwdxdUXdYfo6t8DA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*8bl18HGqRXHgOMofThmchQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/258/1*CImPsX4DIZv2M4o3nNmAZA.png" /></figure><p>Let’s make sure everything is working. Let’s go to S3 and click on the bucket we’ve created for this project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*qgB06TUnzznLkBTn_6KJQg.png" /></figure><p>Go to the Properties tab of your S3 bucket</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*yfWKCPrhw3Zfktmu_vWtpw.png" /></figure><p>Scroll all the way to the bottom of the page, copy &amp; paste the Bucket website endpoint into your browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*Z4CT1xdlT8LJz5QLD0j37Q.png" /></figure><p>Here is the static website:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/0*Ckc0fJcqxMprZMT4.png" /></figure><p>Step 5. Let’s make sure the rest of the Code Pipeline is working.</p><p>I will make a change to the code in GitHub. Navigate over to GitHub into the Repository we used earlier. Make a change or update to the “README.md” file. This is the change I&#39;ll make:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/195/1*_Hgni5FXn7Mishgg3_uRaQ.png" /></figure><p>Once you’ve made the change, click on save. Let’s go back to CodePipeline and select our pipeline. It should have been triggered. It should be in the process of executing the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*1JpPgWR2X6SYjx1CLC-3xA.png" /></figure><p>If your pipeline is in the process of rebuilding, then this was a success.</p><p>Thanks for reading my article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=292369d2fabd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>