<?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 Nathaniel Tulchinsky on Medium]]></title>
        <description><![CDATA[Stories by Nathaniel Tulchinsky on Medium]]></description>
        <link>https://medium.com/@natetulchinsky?source=rss-22ed3afd74e3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gky1BVXh2b3JNi4ew7gcIw.jpeg</url>
            <title>Stories by Nathaniel Tulchinsky on Medium</title>
            <link>https://medium.com/@natetulchinsky?source=rss-22ed3afd74e3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 05:50:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@natetulchinsky/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[Managing data in the cloud with AWS DynamoDB]]></title>
            <link>https://medium.com/@natetulchinsky/managing-data-in-the-cloud-with-aws-dynamodb-ddde2f8b1f2?source=rss-22ed3afd74e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddde2f8b1f2</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[dynamodb]]></category>
            <dc:creator><![CDATA[Nathaniel Tulchinsky]]></dc:creator>
            <pubDate>Mon, 03 Jul 2023 02:22:11 GMT</pubDate>
            <atom:updated>2023-07-03T02:22:11.685Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*saZe3KkGIO2HcinJ2ailqA.png" /></figure><h3>Introduction</h3><p>Data is at the center of our digital lives. Companies today can store, process, maintain, and secure data to hundreds of millions of accounts in databases across the world.</p><p>Databases fall under two categories: Sequel (SQL) and No-Sequel (No-SQL) databases. DynamoDB is an Amazon Web Services (AWS) database service that runs No-SQL databases.</p><p>In this article, I will explain the steps necessary to setup a functioning DynamoDB database and to secure it using principles of least-privilege via an Identity and Access Management (IAM) role and an EC2 instance.</p><h3>Prerequisites</h3><ul><li>An AWS account with IAM Admin permissions</li></ul><h3>Step 1: Table and instance creation</h3><p>Within the AWS console, navigate to the DynamoDB service. Under tables, you will be prompted to create a DynamoDB table. Provide a table name and a Partition Key. This key is part of a sort key, which is used to sort and organize entries within the table. Use all other default settings and save changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kG8Jh37ldL3qLF8anVXtHw.png" /></figure><p>Once created, start adding items into your table. My table listed below on movies is sorted into five columns titled:</p><ul><li>ID for entry ID</li><li>Genre for movie genre</li><li>Movie Title for the name of the movie</li><li>Rating for my personal rating of the movie</li><li>Release Date for the day the movie was released to the public</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*orS6D23LHCoVLJotcb6xxQ.png" /></figure><p>Next, navigate to the EC2 section of the AWS console. Launch an instance with:</p><ul><li>custom name</li><li>the default Amazon Machine Image (AMI)</li><li>t2.micro instance type</li><li>key pair for Secure Shell (SSH) login</li><li>custom security group with Public IP assignment enabled and SSH access allowed</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Q9mTEb3uk5XR-XFjUZqdA.png" /></figure><h3>Step 2: Create and assign role to EC2 instance</h3><p>Upon creation of our EC2 instance, we must assign it a role in order for it to read into our DynamoDB’s table contents.</p><p>Navigate to the Identity and Access Management (IAM) section of the AWS console. Within the Roles section of IAM, create a role. The use case will be EC2, under the AWS service DynamoDB. Provide it a name and then add the following permission name:</p><pre>AmazonDynamoDBReadOnlyAccess</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9nhofvXWDUiHHPoSWr3LiQ.png" /></figure><p>This permission allows the instance to scan and read into DynamoDB tables. It does not allow the instance to write any additional data into the DynamoDB table.</p><p>Once created, navigate back to the EC2 section of the AWS console. Navigate to the EC2 instance’s settings and attach our IAM role to the EC2 instance. If successful, you will see a similar message below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aL4wY5nXHYZMksKNT-xKAQ.png" /></figure><h3>Step 3: Testing</h3><p>With our role now attached to our EC2 instance, we can test to see if the permissions work within our DynamoDB table.</p><p>SSH login to the EC2 instance via a terminal window or EC2 Instance Connect. Once connected, enter the command to list out the DynamoDB table:</p><pre>aws dynamodb list-tables</pre><p>The following output is displayed:</p><pre>[ec2-user@ip-10-10-1-34 ~]$ aws dynamodb list-tables<br>{<br>    &quot;TableNames&quot;: [<br>        &quot;ProjectSeven&quot;<br>    ]<br>}</pre><p>To check if any items are available within the table, enter the following command:</p><pre>aws dynamodb scan --table-name TABLENAME</pre><p>The following output is displayed for my Movies table:</p><pre>[ec2-user@ip-10-10-1-34 ~]$ aws dynamodb scan --table-name ProjectSeven<br>{<br>    &quot;Items&quot;: [<br>        {<br>            &quot;Release Date&quot;: {<br>                &quot;S&quot;: &quot;June 20, 1980&quot;<br>            },<br>            &quot;Movie Title&quot;: {<br>                &quot;S&quot;: &quot;Star Wars Episode V: The Empire Strikes Back&quot;<br>            },<br>            &quot;id&quot;: {<br>                &quot;S&quot;: &quot;2&quot;<br>            },<br>            &quot;Genre&quot;: {<br>                &quot;S&quot;: &quot;Science Fiction&quot;<br>            },<br>            &quot;Rating&quot;: {<br>                &quot;S&quot;: &quot;5.0/5.0&quot;<br>            }<br>        },<br>        {<br>            &quot;Release Date&quot;: {<br>                &quot;S&quot;: &quot;December 15, 1939&quot;<br>            },<br>            &quot;id&quot;: {<br>                &quot;S&quot;: &quot;8&quot;<br>            },<br>            &quot;Movie Title&quot;: {<br>                &quot;S&quot;: &quot;Gone with the wind&quot;<br>            },<br>            &quot;Genre&quot;: {<br>                &quot;S&quot;: &quot;Romance&quot;<br>            },<br>            &quot;Rating&quot;: {<br>                &quot;S&quot;: &quot;5.0/5.0&quot;<br>            }<br>        },<br>        {<br>            &quot;Release Date&quot;: {<br>                &quot;S&quot;: &quot;November 8, 1999&quot;<br>            },<br>            &quot;Movie Title&quot;: {<br>                &quot;S&quot;: &quot;The world is not enough&quot;<br>            },<br>            &quot;id&quot;: {<br>                &quot;S&quot;: &quot;9&quot;<br>            },<br>            &quot;Genre&quot;: {<br>                &quot;S&quot;: &quot;Action&quot;<br>            },<br>            &quot;Rating&quot;: {<br>                &quot;S&quot;: &quot;4.0/5.0&quot;<br>            }<br>        },<br>        {<br>            &quot;Release Date&quot;: {<br>                &quot;S&quot;: &quot;May 25, 1977&quot;<br>            },<br>            &quot;Movie Title&quot;: {<br>                &quot;S&quot;: &quot;Star Wars Episode IV: A New Hope&quot;<br>            },<br>            &quot;id&quot;: {<br>                &quot;S&quot;: &quot;1&quot;<br>            },<br>            &quot;Genre&quot;: {<br>                &quot;S&quot;: &quot;Science Fiction&quot;<br>            },<br>            &quot;Rating&quot;: {<br>                &quot;S&quot;: &quot;5.0/5.0&quot;<br>            }<br>        },<br>        {<br>            &quot;Release Date&quot;: {<br>                &quot;S&quot;: &quot;July 31, 1987&quot;<br>            },<br>            &quot;Movie Title&quot;: {<br>                &quot;S&quot;: &quot;The Living Daylights&quot;<br>            },<br>            &quot;id&quot;: {<br>                &quot;S&quot;: &quot;6&quot;<br>            },<br>            &quot;Genre&quot;: {<br>                &quot;S&quot;: &quot;Action&quot;<br>            },<br>            &quot;Rating&quot;: {<br>                &quot;S&quot;: &quot;4.0/5.0&quot;<br>            }<br>        },<br>        {<br>            &quot;Release Date&quot;: {<br>                &quot;S&quot;: &quot;December 23, 1966&quot;<br>            },<br>            &quot;Movie Title&quot;: {<br>                &quot;S&quot;: &quot;The good, the bad, and the ugly&quot;<br>            },<br>            &quot;id&quot;: {<br>                &quot;S&quot;: &quot;5&quot;<br>            },<br>            &quot;Genre&quot;: {<br>                &quot;S&quot;: &quot;Western&quot;<br>            },<br>            &quot;Rating&quot;: {<br>                &quot;S&quot;: &quot;5.0/5.0&quot;<br>            }<br>        },<br>        {<br>            &quot;Release Date&quot;: {<br>                &quot;S&quot;: &quot;December 9, 1983&quot;<br>            },<br>            &quot;Movie Title&quot;: {<br>                &quot;S&quot;: &quot;Scarface&quot;<br>            },<br>            &quot;id&quot;: {<br>                &quot;S&quot;: &quot;4&quot;<br>            },<br>            &quot;Genre&quot;: {<br>                &quot;S&quot;: &quot;Action&quot;<br>            },<br>            &quot;Rating&quot;: {<br>                &quot;S&quot;: &quot;5.0/5.0&quot;<br>            }<br>        },<br>        {<br>            &quot;Release Date&quot;: {<br>                &quot;S&quot;: &quot;June 25, 1982&quot;<br>            },<br>            &quot;Movie Title&quot;: {<br>                &quot;S&quot;: &quot;Bladerunner&quot;<br>            },<br>            &quot;id&quot;: {<br>                &quot;S&quot;: &quot;7&quot;<br>            },<br>            &quot;Genre&quot;: {<br>                &quot;S&quot;: &quot;Science Fiction&quot;<br>            },<br>            &quot;Rating&quot;: {<br>                &quot;S&quot;: &quot;4.0/5.0&quot;<br>            }<br>        },<br>        {<br>            &quot;Release Date&quot;: {<br>                &quot;S&quot;: &quot;May 25, 1983&quot;<br>            },<br>            &quot;Movie Title&quot;: {<br>                &quot;S&quot;: &quot;Star Wars Episode VI: Return of the Jedi&quot;<br>            },<br>            &quot;id&quot;: {<br>                &quot;S&quot;: &quot;3&quot;<br>            },<br>            &quot;Genre&quot;: {<br>                &quot;S&quot;: &quot;Science Fiction&quot;<br>            },<br>            &quot;Rating&quot;: {<br>                &quot;S&quot;: &quot;4.0/5.0&quot;<br>            }<br>        },<br>        {<br>            &quot;Release Date&quot;: {<br>                &quot;S&quot;: &quot;November 13, 1995&quot;<br>            },<br>            &quot;Movie Title&quot;: {<br>                &quot;S&quot;: &quot;Goldeneye&quot;<br>            },<br>            &quot;id&quot;: {<br>                &quot;S&quot;: &quot;10&quot;<br>            },<br>            &quot;Genre&quot;: {<br>                &quot;S&quot;: &quot;Action&quot;<br>            },<br>            &quot;Rating&quot;: {<br>                &quot;S&quot;: &quot;5.0/5.0&quot;<br>            }<br>        }<br>    ],<br>    &quot;Count&quot;: 10,<br>    &quot;ScannedCount&quot;: 10,<br>    &quot;ConsumedCapacity&quot;: null<br>}</pre><p>My table displays 10 unique items, as there are only 10 items listed in the database.</p><p>To check if the permissions from the role is properly in-place, run the following command:</p><pre>aws dynamodb put-item --table-name TABLENAME --item &#39;ITEMINFORMATION&#39;</pre><p>I get the following error message when I attempt to add an item to my table:</p><pre>[[ec2-user@ip-10-10-1-34 ~]$ aws dynamodb put-item --table-name ProjectSeven --item &#39;{&quot;Release Date&quot;:{&quot;S&quot;: &quot;A Date&quot;},&quot;Movie Title&quot;:{&quot;S&quot;: &quot;A Movie Title&quot;},&quot;id&quot;:{&quot;S&quot;: &quot;11&quot;},&quot;Genre&quot;:{&quot;S&quot;: &quot;A Genre&quot;},&quot;Rating&quot;:{&quot;S&quot;: &quot;Rating&quot;} }&#39;<br><br>An error occurred (AccessDeniedException) when calling the PutItem operation: User: arn:aws:sts::515973910855:assumed-role/ProjectSevenRole/i-0f72834f70f27b37e is not authorized to perform: dynamodb:PutItem on resource: arn:aws:dynamodb:us-east-1:515973910855:table/ProjectSeven because no identity-based policy allows the dynamodb:PutItem action</pre><p>Congratulations! You have successfully setup a functioning DynamoDB database, secured it using principles of least-privilege via an Identity and Access Management (IAM) role and an EC2 instance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddde2f8b1f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scalability: Auto Scaling Groups, High Availability and more]]></title>
            <link>https://medium.com/@natetulchinsky/scalability-auto-scaling-groups-high-availability-and-more-384b60073504?source=rss-22ed3afd74e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/384b60073504</guid>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Nathaniel Tulchinsky]]></dc:creator>
            <pubDate>Mon, 26 Jun 2023 16:50:28 GMT</pubDate>
            <atom:updated>2023-06-26T16:52:49.953Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*APfd6RwLJgFlQrtmOXL64w.png" /></figure><h3>Introduction</h3><p>Companies have rapidly changing infrastructure needs based upon market conditions, demand from clients, and other factors. By shifting resources from on-premises to cloud platforms such as AWS, companies can scale up infrastructure based upon demand. Costs are reduced by eliminating upfront hardware and software purchases.</p><p>In this article I will explain the steps necessary to configure a variety of network infrastructure tools for a web server EC2 instance.</p><h3>Prerequisites</h3><ul><li>An AWS account with IAM Admin permissions</li></ul><h3>Step 1: Basic setup</h3><p>Before deploying our web server EC2 instance, we need to lay out our required networking infrastructure.</p><p>A Virtual Private Cloud (VPC) can be setup in the VPC section of AWS. Make sure to use the IPv4 CIDR of 10.10.0.0/16.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ErSaMFTShqAVvv0qFwDHYQ.png" /></figure><p>Later on, we will need to view our web server EC2 instance publicly via DNS Hostname. Enable DNS hostname in the VPC settings shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T7C6Ih9eDd0OmvLRIFCCTg.png" /></figure><p>To add IP addresses for our web servers, we need to create three public subnets. Add the following IPv4 CIDR:</p><ul><li>10.10.1.0/24</li><li>10.10.2.0/24</li><li>10.10.3.0/24</li></ul><p>When creating subnets, make sure to select the newly created VPC and not the default VPC. In addition, make sure to have different availability zones selected for each of the three subnets. This is important for high availability in case an availability zone goes offline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3c2sEZpCsigQl642zy-AZg.png" /></figure><p>Once subnets are created, turn on Auto-assign Public IP address inside of each subnet’s settings. Our web servers need a public-facing IP address for client devices to connect to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f5toutfR6wNreT6Awhld-w.png" /></figure><p>Now we need to create a route table to route our traffic. Once created, associate the three newly created subnets with our route table via Explicit subnet associations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A3xBR_RmOzkD4lSFYFPQVQ.png" /></figure><p>Next create an internet gateway. This will be needed for access to the internet for our web servers. Attach the internet gateway to our VPC. Once created and attached to the VPC, create a route within the route table pointing all traffic to the internet gateway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ec0jD3UbIRv68N7RfH-FuQ.png" /></figure><p>Lastly, create a security group for web and Secure Shell (SSH) access for our web server EC2 instances. For inbound rules, make sure to select all traffic (0.0.0.0/0) pointing to HTTP (TCP port 80) and SSH (TCP port 22).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n0XYFgYoJaVTu3lSahpkSA.png" /></figure><h3>Step 2: Test network infrastructure with EC2 instances</h3><p>With our infrastructure created, now we can test it with a simple Amazon Linux EC2 instance.</p><p>Navigate to the EC2 section within AWS console to create an EC2 instance.</p><p>For EC2 instance settings, select Amazon Linux as the Amazon Machine Image. Instance type will be t2.micro. Key pair will be a previous key pair. If you need to create a new key pair, select “Create key pair”. Modify network settings to select our VPC, one subnet from our three subnets, our existing security group, and to automatically assign a public IP address.</p><p>After launched, SSH into the instance with the key pair. If successful, you can execute commands within the instance and not within a local environment.</p><h3>Step 3: Create Auto Scaling Group</h3><p>Now that we confirmed our network infrastructure is working, we can setup an auto scaling group for high scalability.</p><p>In the EC2 section of AWS console, select Launch Template. This template is similar to manual creation of EC2 instances. Use same EC2 instance settings as before for Amazon Machine Image, instance type, key pair and network settings. Under advanced details, we need to add our customized Apache Web Server script. Paste in the below code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ip8ubWK0WnHCh6RrAqfAg.png" /></figure><p>Launch the template once completed.</p><p>Once launched, select “Auto Scaling Group”. Enter a name for the group and select the Launch template from before. Select the VPC and availability zones (from subnets). Make the minimum number of instances set to two and the maximum number of instances set to five. Once complete, launch the Auto Scaling Group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xo0DKZvkFstw7TBB2Kn5zw.png" /></figure><p>NOTE: If you do not get the option to proceed, most likely the subnets were all associated in one availability zone. Change the association of a subnet into a different availability zone before proceeding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KNy_Ft8NS0vkt0optE7hPw.png" /></figure><h3>Step 4: Target Group, Application Load Balancer, and testing</h3><p>Next, we need to setup a Target Group and an Application Load Balancer.</p><p>Within Target Group settings, select the target type as Instances. Enter a name and select our VPC from earlier. Register target group targets with the two EC2 instances created from our Auto Scaling Group from earlier. Create the Target Group once finished.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qRfAa1BFRoSaT3xxUxF7sQ.png" /></figure><p>Now to setup an Application Load Balancer. Select Application Load Balancer in the Load Balancer wizard. Provide a name and select Internet-facaing scheme. Choose our VPC and the security group. Forward all traffic to our earlier target group and then create the load balancer.</p><p>Lastly we can test our connection. Navigate to our EC2 instances and select one. Copy the DNS hostname of the EC2 instance and paste it in a new browser window. If successful, you will see the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iSxWspSi1AsFP87iZFrioQ.png" /></figure><p>If unsuccessful, you will get a time out error. Check your security group settings to make sure that HTTP is in an inbound rule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dIXTUdrMMRAN-aEohwTBoA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=384b60073504" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scripting with AWS EC2 and Ubuntu]]></title>
            <link>https://medium.com/@natetulchinsky/scripting-with-aws-ec2-and-ubuntu-ec9b9aaf7aaa?source=rss-22ed3afd74e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec9b9aaf7aaa</guid>
            <dc:creator><![CDATA[Nathaniel Tulchinsky]]></dc:creator>
            <pubDate>Tue, 20 Jun 2023 13:28:05 GMT</pubDate>
            <atom:updated>2023-06-20T13:28:05.818Z</atom:updated>
            <content:encoded><![CDATA[<p>Scripting is a powerful way to customize Amazon Web Services (AWS) EC2 instance settings.</p><p>In this tutorial, we will setup an AWS EC2 t2.micro instance running the Linux distribution Ubuntu. In addition, we will be installing the apache web server with the help of a bash script.</p><h3>Prerequisites:</h3><ul><li>An AWS account with IAM admin credentials</li></ul><h3>Step 1: Setup AWS EC2 t2.micro Instance</h3><p>On the AWS main dashboard, navigate to AWS EC2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PQ5ynGkCb_T7WenIL2D6rg.png" /></figure><p>Select “Launch instance”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*ywcsEiLqTvf6_CksvO-gGA.png" /></figure><p>Name your instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AlqyM5JGFHYEkCZmmJC80A.png" /></figure><p>For Amazon Machine Image (AMI), we will be using the Linux distribution Ubuntu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RznJCHo_K7Y4bmY24YkJXw.png" /></figure><p>Leave the instance type as t2.micro.</p><p>Under “Network settings”, we need to modify the default settings to allow public web access to our instance. Click on “Edit”. Under Auto-assign public IP, click on “Enable”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4wfMi1nSoQoTig_2UpQddA.png" /></figure><p>Next, we will create a security group. Enter a name for the security group followed by a description.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vncJu57TrF4f9-1W4e75OA.png" /></figure><p>We need to add an additional security group rule to enable public access to our EC2 instance. Under type, select Hypertext Transfer Protocol (HTTP) which will use open Transmission Control Protocol (TCP) port 80. For source, enter 0.0.0.0/0 for all incoming traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sw-Ci_0K1vWLN4SdcK4w1A.png" /></figure><h3>Step 2: Script</h3><p>Under the “Advanced details tab, we will need to enter a few Linux commands in the form of a bash script. Scroll down until you see the “User data — optional” field with an open text box.</p><p>The bash script runs the user inputted commands without requiring the user to connect via Secure Shell Protocol into the instance and run the commands manually. This saves time and computing expense for the user.</p><p>To install apache, type in the following commands into the text box.</p><pre>#!bin/bash<br>sudo apt-get update -y<br>sudo apt-get install apache2 -y</pre><p>The command “sudo apt-get update -y” will download and install all available updates for Ubuntu Linux.</p><p>The command “sudo apt-get install apache2 -y” will first download, install, and run the apache2 web service.</p><p>Once entered, we can launch our instance. Select “Launch instance”.</p><h3>Step 3: Testing our Script</h3><p>With our t2.micro EC2 instance launched, we can now test to see if our script ran successfully. Return to the EC2 instance dashboard to view running instances.</p><p>Select the instance. The instance’s public IP address will be listed in the instance summary page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OGaXHjFe58CSMuNrPPkK6A.png" /></figure><p>Copy it and open a new web browser tab. Paste the IP address into the web browser tab.</p><p>If successful, you will see the below web page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v7H2RpQDSI3fiC1A6K7t9w.png" /></figure><p>You have successfully deployed a script on a t2.micro Ubuntu Linux EC2 instance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec9b9aaf7aaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Administration: Users, Groups, Permissions, and more!]]></title>
            <link>https://medium.com/@natetulchinsky/linux-administration-users-groups-permissions-and-more-51ddff70acad?source=rss-22ed3afd74e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/51ddff70acad</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ubuntu]]></category>
            <dc:creator><![CDATA[Nathaniel Tulchinsky]]></dc:creator>
            <pubDate>Mon, 12 Jun 2023 01:48:09 GMT</pubDate>
            <atom:updated>2023-06-12T01:54:25.260Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gMic9yUlkp50CoH0hovVqA.png" /></figure><p>Linux is the most popular server operating system in the world. Understanding how to use Linux and its CLI (Command-Line Interface) will assist in learning broader system administration on multiple operating systems, including Mac OS and Windows OS.</p><p>In this tutorial we will be setting up users, groups, permissions and more within an Amazon Web Services (AWS) EC2 instance running the Linux Distribution Ubuntu Linux v. 22.04 LTS.</p><h3><strong>Prerequisite information</strong></h3><p>Folder names:</p><pre>Developers<br>Operations<br>Analytics</pre><p>Users:</p><pre>User: jwaller<br>Name: Jess Waller<br>Email Address: jwaller@levelupbank.com<br>Group: Developers<br><br>User: bdorsey<br>Name: Blake Dorsey<br>Email Address: bdorsey@levelupbank.com<br>Group: Operations<br><br>User: jewart<br>Name: Joey Ewart<br>Email Address: jewart@levelupbank.com<br>Group: Data Analysts</pre><h3><strong>Step 1: Folder creation and folder permissions</strong></h3><p>We need to first get out of our default user’s home directory. Run the following command:</p><pre>cd /</pre><p>This takes us to the system directory, known as root. This is different from a folder in the system directory called root.</p><p>Now we need to assume superuser (known as Administrator in Windows OS) user to run commands. We can do so by running:</p><pre>sudo su</pre><p>To make the folder, run the following command:</p><pre>mkdir (foldername)</pre><p>We can see they are folders by running the command</p><pre>ls -al</pre><p>We get the following output:</p><pre>total 84<br>drwxr-xr-x  22 root root  4096 Jun 11 23:12 .<br>drwxr-xr-x  22 root root  4096 Jun 11 23:12 ..<br>drwxr-xr-x   2 root root  4096 Jun 11 23:12 Analytics<br>drwxr-xr-x   2 root root  4096 Jun 11 23:12 Development<br>drwxr-xr-x   2 root root  4096 Jun 11 23:12 Operations</pre><p>On the permissions pane, a folder is marked with the first letter as “d”. If there is no “d”, then it is not a folder. To add junk files to our folder, we need to change to the directory by using:</p><pre>cd (foldername)</pre><p>Then run the following command:</p><pre>touch (filename){min..max}.(fileextension)</pre><p>The numbers in between the curly braces correspond to the minimum and maximum number of files created within the folder. In the below example, the minimum created is one file and the maximum created is three files.</p><pre>root@ip-172-31-91-251:/Development# touch file{1..3}.txt<br>root@ip-172-31-91-251:/Development# ls -al<br>total 8<br>drwxr-xr-x  2 root root 4096 Jun 11 23:13 .<br>drwxr-xr-x 22 root root 4096 Jun 11 23:12 ..<br>-rw-r--r--  1 root root    0 Jun 11 23:13 file1.txt<br>-rw-r--r--  1 root root    0 Jun 11 23:13 file2.txt<br>-rw-r--r--  1 root root    0 Jun 11 23:13 file3.txt</pre><p>Now that we’ve created our folders and provided files to them, we need to modify the permissions of the folders. Run the following command:</p><pre>chmod 050 (foldername)</pre><p>The numbers correspond to the permissions set of the folder, in octal notation.</p><p>The maximum notation for a permission set is 7 (4 for read, 2 for write, 1 for execute).</p><p>In the example below, the permissions set is modified to only allow read and execute permission for group access. No user access or system-wide access is allowed for the folders.</p><pre>root@ip-172-31-91-251:/# chmod 050 Analytics/ Development/ Operations/<br>root@ip-172-31-91-251:/# ls -al<br>total 84<br>drwxr-xr-x  22 root root  4096 Jun 11 23:12 .<br>drwxr-xr-x  22 root root  4096 Jun 11 23:12 ..<br>d---r-x---   2 root root  4096 Jun 11 23:13 Analytics<br>d---r-x---   2 root root  4096 Jun 11 23:13 Development<br>d---r-x---   2 root root  4096 Jun 11 23:13 Operations</pre><h3><strong>Step 2: Group creation and folder modification</strong></h3><p>Now that our folders are created, we need to create our groups and provide them access to our created folders.</p><p>We can create a group by running the following command:</p><pre>groupadd (groupname) </pre><p>This adds a group name with a GID (Group Identifier) to Ubuntu.</p><p>To change the ownership of a folder, run the following command:</p><pre>chown :groupname (foldername)/</pre><p>We can verify this by checking the folder structure for Development:</p><pre>root@ip-172-31-91-251:/# chown :Developers Development/<br>root@ip-172-31-91-251:/# ls -al<br>total 84<br>drwxr-xr-x  22 root root        4096 Jun 11 23:12 .<br>drwxr-xr-x  22 root root        4096 Jun 11 23:12 ..<br>d---r-x---   2 root root        4096 Jun 11 23:13 Analytics<br>d---r-x---   2 root Developers  4096 Jun 11 23:13 Development<br>d---r-x---   2 root root        4096 Jun 11 23:13 Operations</pre><p>Follow up for Analytics:</p><pre>root@ip-172-31-91-251:/# chown :Data_Analysts Analytics/<br>root@ip-172-31-91-251:/# ls -al<br>total 84<br>drwxr-xr-x  22 root root           4096 Jun 11 23:12 .<br>drwxr-xr-x  22 root root           4096 Jun 11 23:12 ..<br>d---r-x---   2 root Data_Analysts  4096 Jun 11 23:13 Analytics<br>d---r-x---   2 root Developers     4096 Jun 11 23:13 Development<br>d---r-x---   2 root root           4096 Jun 11 23:13 Operations</pre><p>Follow up for Operations:</p><pre>root@ip-172-31-91-251:/# chown :Operations Operations/<br>root@ip-172-31-91-251:/# ls -al<br>total 84<br>drwxr-xr-x  22 root root           4096 Jun 11 23:12 .<br>drwxr-xr-x  22 root root           4096 Jun 11 23:12 ..<br>d---r-x---   2 root Data_Analysts  4096 Jun 11 23:13 Analytics<br>d---r-x---   2 root Developers     4096 Jun 11 23:13 Development<br>d---r-x---   2 root Operations     4096 Jun 11 23:13 Operations</pre><p>All three groups in our example are now owners of their respective folders.</p><h3>Step 3: User creation and login</h3><p>To create a user enter the following command:</p><pre>useradd (username) -c &quot;Comments&quot; -m -G (groupname)</pre><p>The -c flag stands for comment. This is where we put our user’s full name and email address.</p><p>The -m flag stands for home directory creation for the user in Ubuntu.</p><p>The -G flag stands for group addition. The user will be added to a Ubuntu group based on their username in addition to the specified group name.</p><p>For our three example users, these are the commands:</p><pre>root@ip-172–31–91–251:/# useradd jwaller -c &quot;Jess Waller, email=jwaller@levelupbank.com&quot; -m -G Developers<br>root@ip-172–31–91–251:/# useradd bdorsey -c &quot;Blake Dorsey, email=bdorsey@levelupbank.com&quot; -m -G Operations<br>root@ip-172–31–91–251:/# useradd jewart -c &quot;Joey Ewart, email=jewart@levelupbank.com&quot; -m -G Data_Analysts</pre><p>To set a password for our users, type in the following command:</p><pre>passwd username</pre><p>You will then be prompted to enter the password twice for the user. Once entered, to sign in as the user enter the command:</p><pre>su - username</pre><p>Note: To display the default input prompt in Linux with our user, type in:</p><pre>bash</pre><p>The input prompt will switch to:</p><pre>username@ip-IP_ADDRESS:/#</pre><h3>Step 4: Checking folder access</h3><p>With our users now created and folder permissions in place, let’s check to see if our users can access the folders.</p><p>For Jess Waller:</p><pre>jwaller@ip-172-31-91-251:/$ cd Operations/<br>bash: cd: Operations/: Permission denied<br>jwaller@ip-172-31-91-251:/$ cd Analytics/<br>bash: cd: Analytics/: Permission denied<br>jwaller@ip-172-31-91-251:/$ cd Development/<br>jwaller@ip-172-31-91-251:/Development$ ls -al<br>total 8<br>d---r-x---  2 root Developers 4096 Jun 11 23:13 .<br>drwxr-xr-x 22 root root       4096 Jun 11 23:12 ..<br>-rw-r--r--  1 root root          0 Jun 11 23:13 file1.txt<br>-rw-r--r--  1 root root          0 Jun 11 23:13 file2.txt<br>-rw-r--r--  1 root root          0 Jun 11 23:13 file3.txt</pre><p>For Blake Dorsey:</p><pre>bdorsey@ip-172-31-91-251:/$ cd Development/<br>bash: cd: Development/: Permission denied<br>bdorsey@ip-172-31-91-251:/$ cd Analytics/<br>bash: cd: Analytics/: Permission denied<br>bdorsey@ip-172-31-91-251:/$ cd Operations/<br>bdorsey@ip-172-31-91-251:/Operations$ ls -al<br>total 8<br>d---r-x---  2 root Operations 4096 Jun 11 23:13 .<br>drwxr-xr-x 22 root root       4096 Jun 11 23:12 ..<br>-rw-r--r--  1 root root          0 Jun 11 23:13 file1.txt<br>-rw-r--r--  1 root root          0 Jun 11 23:13 file2.txt<br>-rw-r--r--  1 root root          0 Jun 11 23:13 file3.txt</pre><p>For Joey Ewart:</p><pre>jewart@ip-172-31-91-251:/$ cd Operations/<br>bash: cd: Operations/: Permission denied<br>jewart@ip-172-31-91-251:/$ cd Development/<br>bash: cd: Development/: Permission denied<br>jewart@ip-172-31-91-251:/$ cd Analytics/<br>jewart@ip-172-31-91-251:/Analytics$ ls -al<br>total 8<br>d---r-x---  2 root Data_Analysts 4096 Jun 11 23:13 .<br>drwxr-xr-x 22 root root          4096 Jun 11 23:12 ..<br>-rw-r--r--  1 root root             0 Jun 11 23:13 file1.txt<br>-rw-r--r--  1 root root             0 Jun 11 23:13 file2.txt<br>-rw-r--r--  1 root root             0 Jun 11 23:13 file3.txt</pre><p>You have now successfully created three folders with group permissions and three users with selective access to those folders.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51ddff70acad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running an Apache HTTP Server on a CentOS AWS EC2 Instance]]></title>
            <link>https://medium.com/@natetulchinsky/running-a-apache-http-server-on-a-centos-aws-ec2-instance-30ec22d1926f?source=rss-22ed3afd74e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/30ec22d1926f</guid>
            <dc:creator><![CDATA[Nathaniel Tulchinsky]]></dc:creator>
            <pubDate>Sun, 04 Jun 2023 02:59:56 GMT</pubDate>
            <atom:updated>2023-06-04T03:03:00.344Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wk57Ug7SRHhoc7dyjG4qXg.png" /></figure><p>Web servers are one of millions of servers running in the cloud. A majority of web servers are hosted inside Linux Instances. Linux is an open-source family of Operating Systems (OS) with several distributions (distros) in circulation (i.e. Ubuntu, Mint, Puppy Linux, etc).</p><p>In this tutorial, we will be using the Linux distribution Cent OS in conjunction with an Amazon Web Services (AWS) EC2 instance to run the web service Apache.</p><h3>Prerequisites</h3><p>You will need:</p><ul><li>Stable connection to the Internet</li><li>An AWS Cloud account with Identity and Access Management (IAM) admin permissions</li><li>Access to the AWS CLI interface within your Operating System (Windows, Mac OS, Linux)</li></ul><h3><strong>Part 1: Creating the AWS EC2 Instance</strong></h3><p>Login to the AWS Management Console using your AWS IAM account.</p><p>Select the search bar and type in “EC2”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PQ5ynGkCb_T7WenIL2D6rg.png" /></figure><p>Select “Launch instance”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*ywcsEiLqTvf6_CksvO-gGA.png" /></figure><p>Type in a name for the instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AlqyM5JGFHYEkCZmmJC80A.png" /></figure><p>Within Application and OS Images (Amazon Machine Image), click on the search bar. Type in “Cent OS”. Select the “Browser more AMIs” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*4u3M2PquR9uZPVGW7Eb8qA.png" /></figure><p>Under AWS Marketplace AMIs, choose “Cent OS 7 (x86_64)”. Select “Continue”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mheDy80nOwmri7CRR3DXJw.png" /></figure><p>Under the key pair (login) option, select “Create new key pair”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FO7iwQ7RMQ6mwkLzoV6sLA.png" /></figure><p>Enter in a key pair name and click the “Create key pair” button. The key pair file will download to your downloads folder. Take note of the file path to this folder, it will be needed later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CWUC7e1zhF6xzQ81TMw0qg.png" /></figure><p>Next, we need to edit our EC2 instance’s network settings. Select “Edit” under “Network settings” and scroll down to “Inbound security groups rules”. We will need to add an additional rule for HyperText Transfer Protocol (HTTP) access to our instance.</p><p>For type, select “HTTP”. For source type, select “Custom”, followed by “0.0.0.0/0” as the source. This enables all connections to access the instance’s public Internet Protocol (IP) address on the Transmission Control Protocol (TCP) port 80.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uxw_7usex08tw6XaJIpI9w.png" /></figure><p>We can now launch our instance by selecting “Launch Instance”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*owI3B5GTFsVWt1aYIxEVyw.png" /></figure><h3>Part 2: Running the EC2 Instance and connecting via Secure Shell (SSH)</h3><p>After the CentOS EC2 Instance is launched, select “Connect to instance”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*TmVCkjcMjN-bjTE29OaGOA.png" /></figure><p>Four options are listed. Choose “Secure Shell (SSH) client”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*ag2Q4nY1lSQGCEusqdHxMA.png" /></figure><p>Locate the key pair file that was downloaded earlier during EC2 instance creation. Open a new terminal (Mac OS) or CMD (Windows OS) window and change the console location to the location of the key pair file. For example, if the key pair file is downloaded to the downloads folder, the command is:</p><pre>cd Downloads</pre><p>Once inside of the location of the key pair file, run the following command:</p><pre>chmod 400 KEYPAIRFILENAME.pem</pre><p>This will set your key pair file to not be publicly viewable.</p><p>Lastly, to connect into your CentOS EC2 instance, run the following command:</p><pre>ssh -i &quot;KEYPAIRFILENAME.pem&quot; centos@ec2-INSTANCE_IP_ADDRESS.compute-1.amazonaws.com</pre><p>Your terminal window will now be connected to the EC2 instance via the Secure Shell (SSH) protocol.</p><p>NOTE: If you receive the following error message:</p><pre>Permission denied (publickey,gssapi-keyex,gssapi-with-mic).</pre><p>Make sure that the SSH command points to the username “centos”. If the command points to a different username, the instance will see a mismatch and prevent a successful login.</p><h3>Part 3: Installing and running Apache</h3><p>Before we install and run Apache, we need to first update our CentOS applications to the latest version. Run the following command:</p><pre>yum check-update</pre><p>(Optional) If you want to upgrade applications as well, run the following command:</p><pre>yum check-upgrade</pre><p>To install the Apache application, run the following two commands:</p><pre>sudo yum update httpd<br>sudo yum install httpd</pre><p>If installed correctly, the output will contain this status notice:</p><pre>Installed:<br>  httpd.x86_64 0:2.4.6-99.el7.centos.1                                                                  <br><br>Dependency Installed:<br>  apr.x86_64 0:1.4.8-7.el7                           apr-util.x86_64 0:1.5.2-6.el7_9.1                  <br>  centos-logos.noarch 0:70.0.6-3.el7.centos          httpd-tools.x86_64 0:2.4.6-99.el7.centos.1         <br>  mailcap.noarch 0:2.1.41-2.el7                     <br><br>Complete!</pre><p>To start the Apache application, run the following command:</p><pre>sudo systemctl start httpd</pre><p>The console will output the following:</p><pre>httpd.service - The Apache HTTP Server<br>   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)<br>   Active: active (running) since Sun 2023-06-04 01:47:28 UTC; 5s ago<br>     Docs: man:httpd(8)<br>           man:apachectl(8)<br> Main PID: 1234 (httpd)<br>   Status: &quot;Processing requests...&quot;<br>   CGroup: /system.slice/httpd.service<br>           ├─1234 /usr/sbin/httpd -DFOREGROUND<br>           ├─1235 /usr/sbin/httpd -DFOREGROUND<br>           ├─1236 /usr/sbin/httpd -DFOREGROUND<br>           ├─1237 /usr/sbin/httpd -DFOREGROUND<br>           ├─1238 /usr/sbin/httpd -DFOREGROUND<br>           └─1239 /usr/sbin/httpd -DFOREGROUND<br><br>Jun 04 01:47:28 ip-172-31-80-28.ec2.internal systemd[1]: Starting The Apache HTTP Server...<br>Jun 04 01:47:28 ip-172-31-80-28.ec2.internal systemd[1]: Started The Apache HTTP Server.</pre><p>Now that the Apache application is running, we need to check if the web server is publicly accessible. To get the EC2 instance public IP address, enter the following command:</p><pre>hostname -I</pre><p>Copy and paste this IP address into a new web browser tab. A successful installation will contain the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aTPeA3LdonRX2DnE6u5QNQ.png" /></figure><p>Congratulations! You have successfully installed Apache on CentOS Linux within an Amazon Web Services EC2 instance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30ec22d1926f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to host a static website with an Amazon Web Services S3 bucket]]></title>
            <link>https://medium.com/@natetulchinsky/how-to-host-a-static-website-with-an-amazon-web-services-s3-bucket-973e27407ff3?source=rss-22ed3afd74e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/973e27407ff3</guid>
            <category><![CDATA[aws-s3-bucket]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Nathaniel Tulchinsky]]></dc:creator>
            <pubDate>Mon, 15 May 2023 22:26:47 GMT</pubDate>
            <atom:updated>2023-05-15T22:26:47.461Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_F1d6y66rHAT1ePV-IMQvA.png" /></figure><p>Many companies today host websites over the Internet. This allows customers of companies to interact with clients from all over the world. Over time, operational costs to host a website in-house have increased significantly. This is due to increased computational requirements, increased information requests, and means for storing and encrypting user data.</p><p>We can reduce these operational costs by hosting a website in the Amazon Web Services (AWS) cloud service using an AWS S3 bucket.</p><h3><strong>Prerequisites</strong></h3><p>You will need:</p><ul><li>Stable connection to the Internet</li><li>An AWS Cloud account with Identity and Access Management (IAM) admin permissions</li><li>Access to the AWS CLI interface within your Operating System (Windows, Mac OS, Linux)</li><li>The website HTML file</li></ul><h3><strong>Create AWS S3 bucket and upload website HTML file</strong></h3><ol><li>Go into the AWS CLI interface and type in the following command.</li></ol><pre>aws s3 mb s3://bucket_name</pre><p>Bucket_name is where you type in the name you want for your AWS S3 bucket. This name must be unique from all other buckets created in AWS, so if needed add in random numbers or letters.</p><p>2. To upload our website HTML file to our AWS S3 bucket, type in the following command.</p><pre>aws s3 cp index.html s3://bucket_name</pre><p>If uploaded correctly, you should see it listed in the AWS S3 bucket objects list on the AWS console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6gCRwCltzD-7OJx0MOlcHA.png" /><figcaption>AWS S3 bucket objects list</figcaption></figure><h3><strong>Modifying S3 bucket into static website host</strong></h3><p>3. To turn on static website hosting for our AWS S3 bucket with our website HTML file, type in the following command.</p><pre>aws s3 website s3://Bucket_name/ --index-document index.html</pre><p>This enables the static website hosting option for our AWS S3 bucket. In the AWS S3 bucket properties, scroll down to “Static Website Hosting”. Copy the web address that is provided and paste it in a new browser tab. You may receive an error like the following screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GC4IKbMwFbdUzkRxYSqrkQ.png" /></figure><p>This is a web access denial error message. It means that we cannot access the website because we do not have enough permissions to view it. Let’s now modify our website permissions so we can view the website.</p><p>4. Within the AWS S3 bucket GUI, navigate to the permissions tab within the bucket. Under the subheading “Block public access (bucket settings)”, select “Edit”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K90Uoa1fX58Hwf2iqQZJfw.png" /></figure><p>Uncheck the box “Block <em>all </em>public access”, followed by “Save changes”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5XVmuXMZzUvYFbH_EouUJw.png" /></figure><p>Type in “confirm” to confirm the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*h0eDOLzYPWYEGO_qzM9s3A.png" /></figure><p>5. We now need to add permissions to the website via an AWS S3 bucket policy. In the bucket permissions, scroll to “Bucket Policy” followed by “Edit”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aZpFjTM1g4hmEqvbc8e1Uw.png" /></figure><p>6. We are now prompted to write some code in JSON. This code will provide the necessary permissions for public access. This code is shown below, courtesy of <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/HostingWebsiteOnS3Setup.html">AWS S3 documentation</a>:</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Sid&quot;: &quot;AllowPublicAccesstoObjects&quot;,<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Principal&quot;: &quot;*&quot;,<br>            &quot;Action&quot;: &quot;s3:GetObject&quot;,<br>            &quot;Resource&quot;: &quot;EnterABucketARNHere/*&quot;<br>        }<br>    ]<br>}</pre><p>Copy and paste it into the bucket policy. Under Resource, copy and replace the “EnterABucketARNHERE” with the bucket ARN. This information is located directly above the policy code block in AWS S3 bucket policy. Once replaced, select “Save changes”.</p><p>Our changes to the bucket policy are now saved. Now we can test connecting to our website to see if permissions are working.</p><p>7. Navigate back to the properties tab of our AWS S3 bucket and select “Properties”. Scroll down to the bottom for the subheading “Static website hosting”. A bucket website endpoint address is listed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kD0-kvCzgaLXb4cRGSoZcg.png" /></figure><p>Copy and paste it into a new browser tab. If done correctly, the index.html file will appear on your screen. This is what my website looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GY0YHaYkkFx_wBIlUwHnxA.png" /></figure><p>You have successfully setup an AWS S3 bucket for static website hosting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=973e27407ff3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>