<?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: Arttu Hanska</title>
    <description>The latest articles on DEV Community by Arttu Hanska (@archinowsk).</description>
    <link>https://dev.to/archinowsk</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%2F476151%2F94143f5f-9efd-42c8-86b6-8c65868aa30b.jpeg</url>
      <title>DEV Community: Arttu Hanska</title>
      <link>https://dev.to/archinowsk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/archinowsk"/>
    <language>en</language>
    <item>
      <title>My journey to become AWS Certified Solutions Architect</title>
      <dc:creator>Arttu Hanska</dc:creator>
      <pubDate>Sun, 16 Oct 2022 13:30:38 +0000</pubDate>
      <link>https://dev.to/archinowsk/my-journey-to-become-aws-certified-solutions-architect-2g16</link>
      <guid>https://dev.to/archinowsk/my-journey-to-become-aws-certified-solutions-architect-2g16</guid>
      <description>&lt;p&gt;I became AWS Certified Solutions Architect earlier this year. Here is my journey and what I learned.&lt;/p&gt;

&lt;h2&gt;
  
  
  October: Starting out
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://www.reaktor.com/"&gt;company&lt;/a&gt; I work at hosted a guided study group to become AWS Certified Solutions Architect. I had been using the AWS PaaS platform &lt;a href="https://aws.amazon.com/elasticbeanstalk/"&gt;Elastic Beanstalk&lt;/a&gt; to host my hobby project and fiddled with &lt;a href="https://aws.amazon.com/lambda/"&gt;Lambda&lt;/a&gt; but honestly, I was pretty lost with AWS. So I figured it would be a great time to give my AWS knowledge a boost!&lt;/p&gt;

&lt;p&gt;We formed a study group that met once a week to comment on progress and discuss questions. At the first session, we all signed up for the certification exam, which would be a multiple-choice exam. Mine was scheduled for December. 2-3 months should be enough, right?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Protip&lt;/strong&gt;: I chose “English as a second language” from exam accommodations which gave me +30 minutes to complete the exam. This doesn’t affect the received certificate in any way.&lt;/p&gt;

&lt;p&gt;For study materials we chose A Cloud Guru’s course &lt;a href="https://acloudguru.com/course/aws-certified-solutions-architect-associate-saa-c02"&gt;AWS Certified Solutions Architect - Associate (SAA-C02)&lt;/a&gt; (note: updated &lt;a href="https://acloudguru.com/blog/engineering/new-aws-saa-c03-exam"&gt;SAA-C03&lt;/a&gt; is available). Different sections were clearly split into chapters with videos, quizzes, and interactive labs. At the end of the section, there was a summary of everything covered. The interactive labs were pretty neat: a new AWS Console login is generated for you and you can easily play around with a real environment within the lab’s boundaries. A practice exam was also included. &lt;/p&gt;

&lt;p&gt;All good, ready to start learning!&lt;/p&gt;

&lt;h2&gt;
  
  
  November: Steady progress …?
&lt;/h2&gt;

&lt;p&gt;Four weeks passed. I had squeezed a solid 3-4h a week into studying. Cloud Guru’s materials were great and since the videos were 5-15min long it was easy to watch one whenever there was some free time.&lt;/p&gt;

&lt;p&gt;I was doing steady progress… until I looked at the course overview and noticed I had completed 20% of the course. I checked the course details again: 45.9 hours of content! With my pace of 3-4h a week it would take me 11-15 weeks. And I would require some more time for practice exams and rehearsal. The obvious conclusion was that I had to increase the weekly hours. At the end of November, I was at a solid 50%, not even close to being on schedule.&lt;/p&gt;

&lt;h2&gt;
  
  
  December: Oh shit, oh shit, oh shit
&lt;/h2&gt;

&lt;p&gt;Exam date and Christmas holidays were closing by. I squeezed in more weekly hours, I wanted to finish this in time! I studied 8-10 hours a week which started to take a toll with work and family. Stress was slowly building up and I just wanted this to be over. Other study group members were celebrating their passed exams and I didn’t want to be the one to quit.&lt;/p&gt;

&lt;p&gt;The exam date came closer and I was at 85% of my study materials, without any rehearsal or practice exams. Okay, I was not going to complete this in time. With great hesitation, I rescheduled the exam to January. Now off to the Christmas holidays!&lt;/p&gt;

&lt;h2&gt;
  
  
  January: Finishing line!
&lt;/h2&gt;

&lt;p&gt;New year, I had almost completed the study materials. Just a little crunch time during the last days of the Christmas holidays and I had a full 100% completed!&lt;/p&gt;

&lt;p&gt;Now that I had completed everything, I was ready for my first practice exam! Turns out, you can squeeze quite many details into 45.9 hours of content. Also, it turns out there are gotchas like “all these options are technically correct, but this is correct because it’s most cost-effective”. After the first practice exam, it was obvious I still had much rehearsing to do.&lt;/p&gt;

&lt;p&gt;I returned to watch the summaries of each chapter and rewatched details here and there. I did 4-5 more practice exams and things started to make sense. My new exam date came closer but I was starting to feel confident!&lt;/p&gt;

&lt;p&gt;On Jan 13th I went to the certification location and after nervously waiting in the lobby, was directed to a classroom with a computer. The exam had started for real. &lt;/p&gt;

&lt;p&gt;I started to go over the questions and what the hell, many of them were completely different from the practice exams! Not only that, the questions and answer options were much longer and more detailed. I couldn’t use the routine gathered from the practice exams and had to read everything extra carefully so I wouldn’t miss any technical details.&lt;/p&gt;

&lt;p&gt;After three hours, I had answered all the questions. I submitted my answers and with a beating heart and cold hands, I watched the final score load… PASSED! I had quite a few wrong answers, but not enough to fail.&lt;/p&gt;

&lt;p&gt;Finally, this whole journey would be at an end!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;So I’m an AWS Certified Solutions Architect now. I studied different services, infrastructures, and terminologies for hours. What did I end up with?&lt;/p&gt;

&lt;p&gt;Towards the end, I realized that studying for a certification exam did not feel like learning new tech. Usually, I’m learning new stuff hands-on; I have a problem to solve. Studying for the certification exam felt like studying for a high school exam. Cramming loads of stuff into my head, without any real use.&lt;/p&gt;

&lt;p&gt;So, was the certification study a waste of time? Absolutely not! I learned a ton of different high-level concepts and terminology I will see in my daily work. Now I have a better grasp of what everything means and how different things interconnect. Just adjust your expectations.&lt;/p&gt;

&lt;p&gt;I still don’t know how to really use any of the AWS services I learned or how to build solutions with them. &lt;/p&gt;

&lt;p&gt;But I know where to start.&lt;/p&gt;

</description>
      <category>aws</category>
    </item>
    <item>
      <title>AWS: Migrating from Elastic Beanstalk to App Runner</title>
      <dc:creator>Arttu Hanska</dc:creator>
      <pubDate>Wed, 24 Aug 2022 10:40:00 +0000</pubDate>
      <link>https://dev.to/archinowsk/aws-migrating-from-elastic-beanstalk-to-app-runner-4f2i</link>
      <guid>https://dev.to/archinowsk/aws-migrating-from-elastic-beanstalk-to-app-runner-4f2i</guid>
      <description>&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;I’ve been using AWS &lt;a href="https://aws.amazon.com/elasticbeanstalk/" rel="noopener noreferrer"&gt;Elastic Beanstalk&lt;/a&gt; for five years to host my &lt;a href="https://github.com/ropekonsti/konsti" rel="noopener noreferrer"&gt;hobby app&lt;/a&gt;. The application is dockerized and I have two environments: testing and production. I’ve been running it with &lt;code&gt;t2.small&lt;/code&gt; instances since anything smaller cannot handle building Docker containers.&lt;/p&gt;

&lt;p&gt;I’ve been deploying new releases using &lt;a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3.html" rel="noopener noreferrer"&gt;EB CLI&lt;/a&gt;. I would say &lt;code&gt;eb deploy prod&lt;/code&gt; and the new version is deployed. Elastic Beanstalk’s &lt;a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker.html" rel="noopener noreferrer"&gt;Docker Platform&lt;/a&gt; would then pick &lt;code&gt;Dockerfile&lt;/code&gt; from the project root and everything just worked.&lt;/p&gt;

&lt;p&gt;I need &lt;a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html" rel="noopener noreferrer"&gt;Application Load Balancer&lt;/a&gt; (ALB) for SSL/HTTPS. ALBs are quite expensive for hobby projects and since I had two environments, I needed two. Later it became possible to &lt;a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2020-09-10-shared-alb.html" rel="noopener noreferrer"&gt;share Application Load Balancer amongst multiple Elastic Beanstalk environments&lt;/a&gt; so only one was required. Before this, I dabbled with &lt;a href="https://gist.github.com/tony-gutierrez/198988c34e020af0192bab543d35a62a?permalink_comment_id=3186299#gistcomment-3186299" rel="noopener noreferrer"&gt;providing SSL with Let’s Encrypt&lt;/a&gt; so I would not need load balancers at all. Cost wise this was effective, but managing it turned out to be too work-intensive and would’ve required a complete rewrite to support Amazon Linux 2. So I was stuck with one ALB which would hog around 30% of operating costs.&lt;/p&gt;

&lt;p&gt;Then came the new service AWS &lt;a href="https://aws.amazon.com/apprunner/" rel="noopener noreferrer"&gt;App Runner&lt;/a&gt; with the following sales pitch:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;App Runner builds and deploys the web application automatically, load balances traffic with encryption, and scales to meet your traffic needs&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sounds good to me, let’s give it a try!&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;The first step was to figure out how to roll out a new App Runner service. Luckily there are plenty of great guides to do this. &lt;a href="https://dev.to/aws-builders/the-easiest-way-to-deploy-services-on-aws-using-app-runner-3pf2"&gt;I followed this one&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I want to deploy from my GitHub repository so as instructed I installed &lt;a href="https://docs.aws.amazon.com/dtconsole/latest/userguide/connections-create-github.html" rel="noopener noreferrer"&gt;AWS Connector for GitHub&lt;/a&gt; to my GitHub organization. Then everything else was a breeze: choose repository and branch and toggle automatic deployments when the repository changes. No need to run manual &lt;code&gt;eb deploy&lt;/code&gt; anymore!&lt;/p&gt;

&lt;p&gt;The service can be configured via user interface or &lt;code&gt;apprunner.yaml&lt;/code&gt; file. I’ll continue with the user interface but will most likely change to the config file once everything is working.&lt;/p&gt;

&lt;p&gt;Then comes the first interesting part: I have to add commands for building and starting the app. Elastic Beanstalk did not require these, it just picked the &lt;code&gt;Dockerfile&lt;/code&gt; which had all steps defined.  Seems like I won’t be using my &lt;code&gt;Dockerfile&lt;/code&gt; but the scripts the &lt;code&gt;Dockerfile&lt;/code&gt; was using. This means I cannot define the base image or control how the container OS is built. This might be an issue at some point.&lt;/p&gt;

&lt;p&gt;I have to choose container build runtime. I happen to use Nodejs 14 which is available, but there is a possibility that you might be using something that’s not. &lt;/p&gt;

&lt;p&gt;Adding environment variables is similar to Elastic Beanstalk, just filling key-value fields. I’ll leave the remaining configs as defaults. Then I hit “Create service” and ~5 minutes later I have a running application! Or almost.&lt;/p&gt;

&lt;p&gt;Turns out my build command needed changing but updates were rolled back automatically. How do I debug this? App Runner’s user interface doesn’t show much. Took me a moment to find the link to CloudWatch and from there I was able to find the relevant logs. &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%2Fuploads%2Farticles%2F6nltg4xverfhkuy0s0wy.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%2Fuploads%2Farticles%2F6nltg4xverfhkuy0s0wy.png" alt="CloudWatch button location"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Turns out I was only installing prod dependencies but required dev dependencies as well. After fixing this, I had a running app and it only took me a couple of hours!&lt;/p&gt;

&lt;p&gt;I’ll have to redo these steps to add a second service for my second environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Custom domain
&lt;/h2&gt;

&lt;p&gt;App Runner provides me with a domain like &lt;code&gt;foobar.eu-west-1.awsapprunner.com&lt;/code&gt;. The last thing was to add a custom domain like &lt;code&gt;example.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Adding a custom domain is straightforward. App Runner’s user interface gives me DNS CNAME records for certificate validation and a CNAME record pointing to the App Runner domain. Copy these to DNS settings and wait for DNS settings to propagate.&lt;/p&gt;

&lt;p&gt;I have two domains, &lt;code&gt;example.com&lt;/code&gt; and &lt;code&gt;test.example.com&lt;/code&gt;. I’m using &lt;a href="https://aws.amazon.com/route53/" rel="noopener noreferrer"&gt;Route 53&lt;/a&gt; as a DNS provider. &lt;/p&gt;

&lt;p&gt;Then I found this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you're using Amazon Route 53 as your DNS provider, you can add a subdomain, but support for adding a root domain isn't available at this time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That’s a bummer. So &lt;code&gt;example.com&lt;/code&gt; will not work. I moved the test environment with domain &lt;code&gt;test.example.com&lt;/code&gt; to App Runner but I have to change my DNS provider to get the production domain to work. Hopefully, this will get fixed in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I wanted to move my dockerized app running in Elastic Beanstalk to App Runner. Getting started with App Runner took me maybe an hour, then another hour fiddling with settings, and a third one to figure out custom domains. Not bad!&lt;/p&gt;

&lt;p&gt;Liked:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The getting started experience was great.&lt;/li&gt;
&lt;li&gt;Configuring auto-deployment on GitHub repository change was a checkbox. No need to add anything to my CI pipeline!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Didn’t like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Silently failing deployments. Took me a while to figure out where the relevant logs are. They were in CloudWatch.&lt;/li&gt;
&lt;li&gt;Not being able to use root domain as custom domain when using Route 53. This forces me to change my DNS provider.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Overall the feeling with App Runner is pretty similar to Elastic Beanstalk. It just does a better job at abstracting the infrastructure away and there are no separate costs for running different services like a load balancer. I have a feeling there will be more constraints I haven’t faced yet, but for now I’m happy with the result!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>tutorial</category>
      <category>docker</category>
      <category>node</category>
    </item>
  </channel>
</rss>
