<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: AlexeyRomanchenko</title>
    <description>The latest articles on DEV Community by AlexeyRomanchenko (@alexeyromanchenko).</description>
    <link>https://dev.to/alexeyromanchenko</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F319076%2F03b08d99-e362-4064-8eab-f6d951a7636f.jpg</url>
      <title>DEV Community: AlexeyRomanchenko</title>
      <link>https://dev.to/alexeyromanchenko</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alexeyromanchenko"/>
    <language>en</language>
    <item>
      <title>How to deploy SPA as a static website using AWS S3</title>
      <dc:creator>AlexeyRomanchenko</dc:creator>
      <pubDate>Fri, 05 Feb 2021 21:16:05 +0000</pubDate>
      <link>https://dev.to/alexeyromanchenko/how-to-deploy-spa-as-a-static-website-using-aws-s3-1adg</link>
      <guid>https://dev.to/alexeyromanchenko/how-to-deploy-spa-as-a-static-website-using-aws-s3-1adg</guid>
      <description>&lt;p&gt;Amazon web services allow you to store different files, using amazon S3 buckets. Everyone can store images or libraries, use it like CDN or similar to it. Also it allows us to deploy frontend web application, connect any domain you want (and you have bought previously).&lt;br&gt;
At first, let's create our frontend application. I will use Create React App template, but you can use the same way Angular, Vue or just static html file. It depends on you.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjypbiv7s9182po97c0vp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjypbiv7s9182po97c0vp.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you have created and developed your app, you have to create a minified bundle.In Create React App for its deploying you have to run command npm run build, after folder build will be created, where minified bundle is located (I believe so).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0mqgpttccwih7j4lmw2s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0mqgpttccwih7j4lmw2s.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AWS S3&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3nlgna095jonzanmge7w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3nlgna095jonzanmge7w.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's create s3 bucket, that supposes to be our static website's hosting. For this purposes we have to create S3 bucket with a public access.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpnjnt4tgc5nab853qhnt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpnjnt4tgc5nab853qhnt.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the bucket was created we should go into that bucket.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frzlknikxfmyhxog4kdd4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frzlknikxfmyhxog4kdd4.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In "Properties" tab at the same bottom of the page you can find "Static website hosting" block. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd2wfowd2a8j3e1b54m78.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd2wfowd2a8j3e1b54m78.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You have to enable it and specify default index file. If you use frontend routing system without hash separating, you should specify index file like an error file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0qnn7ae5romj3xv95vbx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0qnn7ae5romj3xv95vbx.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please, don't forget to upload your files into the bucket.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8gzrx28ts4vmi0q97ac4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8gzrx28ts4vmi0q97ac4.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The last step of our deployment will be specifying bucket's policy in the "Permissions" tab. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwp5of79gh53r1m4er4nl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwp5of79gh53r1m4er4nl.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You have to edit bucket's policy in this way, don't forget to save the policy: &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::your-backet-name/*"
        }
    ]
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Finally, in the "Properties" tab , where we previoulsy enabled static website hosting we can find the url, that allows to visit our frontend web application: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5apwshkpy0bgz4ilrgp3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5apwshkpy0bgz4ilrgp3.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's check the link:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fc5nd51h350ejcjj6rb7b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fc5nd51h350ejcjj6rb7b.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We deployed our frontend!&lt;/p&gt;

&lt;p&gt;P.S. In next articles I assume to create backend microservices using AWS Lambda for our frontend application. And for now, you can find pretty good manual how to deploy frontend application in Azure   &lt;a href="https://dev.to/magervalentine/deploy-spa-with-azure-blob-storage-in-minutes-7c9"&gt;https://dev.to/magervalentine/deploy-spa-with-azure-blob-storage-in-minutes-7c9&lt;/a&gt; &lt;/p&gt;




&lt;p&gt;Image wa taken from aws.amazon.com&lt;/p&gt;

</description>
      <category>aws</category>
      <category>react</category>
      <category>s3</category>
      <category>spa</category>
    </item>
    <item>
      <title>AWS newbie's overview</title>
      <dc:creator>AlexeyRomanchenko</dc:creator>
      <pubDate>Tue, 26 Jan 2021 20:04:41 +0000</pubDate>
      <link>https://dev.to/alexeyromanchenko/aws-newbie-s-overview-g74</link>
      <guid>https://dev.to/alexeyromanchenko/aws-newbie-s-overview-g74</guid>
      <description>&lt;p&gt;Modern programming differs from programming five to ten years ago. Application architectures changed too much, as well as their ways of deployment. My previous experience was connected with old styled monolith ASP.NET web applications. I had one web app and I had to deploy it on a premises’ server, where the IIS web server was installed. Sometimes my small and cozy team had problems with strange issues. For example, our web server froze each time we deployed every new version of our app. We did not have solid DevOps knowledge, so we learned some basic IIS functionality, and from time to time tried to make some devops work.&lt;/p&gt;

&lt;p&gt;Last month, I changed my job. We use interesting microservice architecture and store our services in the AWS cloud. It is interesting to discover new ways to create API routing using API Gateway. To make a long story short, this service allows you to create endpoints for the backend app, connect small (or even big) services with endpoints, protect your endpoints with authorization, or check necessary headers in requests.&lt;/p&gt;

&lt;p&gt;Last week, I had a pretty tricky moment with sending images to my backend. I could not accept multipart/form-data requests from my frontend. The backend returned a cors error, while the application/json header was accepted.&lt;/p&gt;

&lt;p&gt;AWS has a great tool to create microservices with lambda functions: everyone can create APIs using different programming languages like C#, Javascript, Java, Go, Python.&lt;/p&gt;

&lt;p&gt;Lambda functions represent well-known serverless architecture where you do not have to worry about your server troubles. &lt;/p&gt;

&lt;p&gt;Everyone can use it for small units of work, such as receiving something from a database, or inserting some amount of data to a database, or somewhere else.  Lambda is not a great option for long tasks, because it has an execution time limit of 15 minutes.&lt;br&gt;
Another service I learned was S3 storage, where Amazon allows everyone to store different files, like images (to create your own storage, and make it public or private ), or even you can use it to host static frontend applications.&lt;/p&gt;

&lt;p&gt;For people who want to deploy their applications and not use lambda functions, they can easily deploy them using Elastic Beanstalk, where you upload a zip file with your app and in some minutes it is deployed. During its deployment Elastic Beanstalk creates a virtual machine that is needed for your application. Don’t forget about if you are using the free tier period, because after that period they will start charging you.&lt;/p&gt;

&lt;p&gt;Finally, you can connect your existing domain (or buy a new one) with the Route 53 service, just add a hosted zone for the domain you have chosen. AWS takes 50 US cents per month for adding each hosted zone to your account. &lt;/p&gt;

&lt;p&gt;In conclusion, AWS has a big variety of services that could be interesting for developers and helpful as well.&lt;/p&gt;




&lt;p&gt;(the image was taken from aws.amazon.com)&lt;/p&gt;

</description>
      <category>aws</category>
      <category>newbie</category>
      <category>iis</category>
      <category>serverless</category>
    </item>
  </channel>
</rss>
