<?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: Trevor S</title>
    <description>The latest articles on DEV Community by Trevor S (@tside777).</description>
    <link>https://dev.to/tside777</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%2F715925%2F6ff60bf3-08f9-493c-b158-737aa0908174.png</url>
      <title>DEV Community: Trevor S</title>
      <link>https://dev.to/tside777</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tside777"/>
    <language>en</language>
    <item>
      <title>Growing Outside of Work: My Journey with the Cloud Resume Challenge</title>
      <dc:creator>Trevor S</dc:creator>
      <pubDate>Fri, 21 Apr 2023 21:18:12 +0000</pubDate>
      <link>https://dev.to/tside777/growing-outside-of-work-my-journey-with-the-cloud-resume-challenge-2o81</link>
      <guid>https://dev.to/tside777/growing-outside-of-work-my-journey-with-the-cloud-resume-challenge-2o81</guid>
      <description>&lt;p&gt;As someone who's relatively early in their software development career, I'm always looking for opportunities to grow my skillset. While I do regularly work with AWS in my day to day, sometimes it's good to just &lt;em&gt;play&lt;/em&gt; in the cloud— and in a big company where much of the infrastructure work is abstracted away from developers by a few core teams, play time isn't always apparent.&lt;/p&gt;

&lt;p&gt;That's why when I discovered the &lt;a href="https://cloudresumechallenge.dev/"&gt;Cloud Resume Challenge&lt;/a&gt; by Forrest Brazeal, I knew I had to partake. This 16-step challenge helped refine my understanding of some key cloud components, and how they can interoperate to quickly standup a basic web app. I figured since I already had an AWS Solutions Architect cert, it wouldn't hurt to spend some more time "walking the walk" on my cloud skills.&lt;/p&gt;

&lt;p&gt;Feel free to check my site out at &lt;a href="http://www.trevorscloudresume.com"&gt;www.trevorscloudresume.com&lt;/a&gt;, as well as my &lt;a href="https://github.com/Tside777/Cloud_Resume_Infra"&gt;frontend&lt;/a&gt; and &lt;a href="https://github.com/Tside777/Cloud_Resume_Backend"&gt;backend&lt;/a&gt; repos.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started with the frontend
&lt;/h2&gt;

&lt;p&gt;If we want to deploy a resume site, the first step is to... build a resume site! This took me about an hour of messing about in VS Code to get an HTML skeleton laid out, with the idea being to recreate something similar to a traditional paper resume. The styling is focused on alignment and readability, and while I would like to go back and pretty it up later, this project wasn't about flexing my design chops.&lt;/p&gt;

&lt;h2&gt;
  
  
  Initial Deployment - AWS Console
&lt;/h2&gt;

&lt;p&gt;Once I had my source files ready to rock, it was simple enough to upload everything to an S3 bucket, and &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html"&gt;enable static website hosting&lt;/a&gt;. This works just fine for a basic static site, but the project calls for the use of a CloudFront Distribution to enable HTTPS, and custom domain routing with Route53. I found &lt;a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/getting-started-cloudfront-overview.html"&gt;this guide&lt;/a&gt; to be particularly helpful in getting everything stood up through the console. &lt;/p&gt;

&lt;p&gt;As an added bonus, it shows you how to configure redirects so that users can visit your site with or without the www subdomain. (Try going straight to &lt;a href="//trevorscloudresume.com"&gt;trevorscloudresume.com&lt;/a&gt; to see how it redirects you automatically!)&lt;/p&gt;

&lt;h2&gt;
  
  
  The Backend
&lt;/h2&gt;

&lt;p&gt;Once my site was stood up, I needed to build out the user count API. Through the console, I set up a &lt;a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html"&gt;DynamoDB table&lt;/a&gt; and created a user count item. Getting my lambda to interface with AWS resources was a breeze with the &lt;a href="https://aws.amazon.com/sdk-for-python/"&gt;Boto3 SDK&lt;/a&gt;. You can see my Python code that increments the user count whenever someone visits the site &lt;a href="https://github.com/Tside777/Cloud_Resume_Backend/blob/master/src/updateUserCount.py"&gt;here&lt;/a&gt;. The key is the usage of the &lt;code&gt;update_item&lt;/code&gt; method that comes from Boto3.&lt;/p&gt;

&lt;p&gt;Once the Lambda was in place, I needed to make it accessible as an API endpoint with &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html"&gt;API Gateway&lt;/a&gt;. Again, through the console, all of this setup was quick and easy. The only gotcha was making sure to &lt;a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-cors-console.html"&gt;enable CORS&lt;/a&gt;, but even that process was fairly straightforward.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Foray into IaC
&lt;/h2&gt;

&lt;p&gt;I had never touched Terraform, and my IaC experience prior to this was fairly limited. But boy, did I get plenty of practice here. Some parts were certainly easier than others, and HashiCorp has some very thorough &lt;a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs"&gt;documentation&lt;/a&gt; to guide you.&lt;/p&gt;

&lt;p&gt;Here are some of the pain points I had and the lessons I learned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you're using Terraform to manage your Route53 domain, setting up the certificate validation can be a little tricky, but the &lt;a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acm_certificate_validation"&gt;&lt;code&gt;aws_acm_certificate_validation&lt;/code&gt;&lt;/a&gt; documentation helped!&lt;/li&gt;
&lt;li&gt;If you use Terraform to specify any DynamoDB &lt;a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/dynamodb_table_item"&gt;item(s)&lt;/a&gt;, there's a good chance any updates you make to those items via your API will get blown away on the next &lt;code&gt;terraform apply&lt;/code&gt;, so be sure to only worry about setting up the initial table.&lt;/li&gt;
&lt;li&gt;The biggest wall I hit by far was enabling CORS for my API. &lt;a href="https://registry.terraform.io/modules/squidfunk/api-gateway-enable-cors/aws/latest"&gt;This module&lt;/a&gt; by squidfunk trivializes the process, but since this is a separate module, it may not trigger a re-deployment of your API depending on your configuration. I spent hours trying to figure out why I was having CORS issues when trying to call my API, only to realize the OPTIONS endpoint wasn't actually staged and deployed on each &lt;code&gt;terraform apply&lt;/code&gt;. &lt;a href="https://github.com/Tside777/Cloud_Resume_Backend/blob/master/modules/aws-api-gateway/main.tf#L53"&gt;Here's&lt;/a&gt; how I set up my &lt;code&gt;aws_api_gateway_deployment&lt;/code&gt; configuration to trigger a re-deploy whenever a change to the gateway config, and/or to my root terraform file (where the CORS module lies) is detected.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CI/CD With GitHub Actions
&lt;/h2&gt;

&lt;p&gt;This part was a lot of fun. I've been using CI/CD pipelines everywhere I've worked since my first internship, but I never had the opportunity to build one from the ground up. For anyone who doesn't know, GitHub Actions let's you automate your builds, testing, and deployments. You can create workflows that run on GitHub-provided Linux, Windows, or macOS machines, or on your own runner if you so choose.&lt;/p&gt;

&lt;p&gt;GitHub's &lt;a href="https://docs.github.com/en/actions"&gt;documentation&lt;/a&gt; is great, and setting up workflows to run my tests and deploy my changes was easy enough. To simplify your life, there are tons of pre-built actions on the &lt;a href="https://github.com/marketplace?type=actions"&gt;marketplace&lt;/a&gt;. The ones that helped me out the most were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/marketplace/actions/checkout"&gt;Checkout&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/marketplace/actions/configure-aws-credentials-for-github-actions"&gt;Configure AWS Credentials For GitHub Actions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/marketplace/actions/hashicorp-setup-terraform"&gt;Setup Terraform&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One final note here: to make my existing Terraform state visible to the runners, I needed to setup a &lt;a href="https://developer.hashicorp.com/terraform/language/settings/backends/configuration"&gt;Backend Configuration&lt;/a&gt; and store my state files in an S3 bucket.&lt;/p&gt;

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

&lt;p&gt;If you got this far, thank you for reading! I learned a lot from this project, got to walk away with a convenient way to share my resume going forward! If you're new to the cloud and looking for hands-on experience building an application from start to finish, I highly recommend taking on the &lt;a href="https://cloudresumechallenge.dev/"&gt;Cloud Resume Challenge&lt;/a&gt; yourself.&lt;/p&gt;

&lt;p&gt;If you have any questions, feel free to reach me at &lt;a href="mailto:trevor@trevorscloudresume.com"&gt;trevor@trevorscloudresume.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>devops</category>
      <category>aws</category>
      <category>career</category>
    </item>
  </channel>
</rss>
