<?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>Forem: N Heath</title>
    <description>The latest articles on Forem by N Heath (@neheath).</description>
    <link>https://forem.com/neheath</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%2F1236121%2Ff10c4864-0e88-4fa1-9923-a20c764e2e67.jpeg</url>
      <title>Forem: N Heath</title>
      <link>https://forem.com/neheath</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/neheath"/>
    <language>en</language>
    <item>
      <title>Unraveling the Monolith: Terraform Configuration Refactoring in Depth</title>
      <dc:creator>N Heath</dc:creator>
      <pubDate>Wed, 10 Jan 2024 21:54:44 +0000</pubDate>
      <link>https://forem.com/neheath/unraveling-the-monolith-terraform-configuration-refactoring-in-depth-33gj</link>
      <guid>https://forem.com/neheath/unraveling-the-monolith-terraform-configuration-refactoring-in-depth-33gj</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;In the intricate domain of infrastructure as code (IaC), mastering the art of efficiently managing Terraform configurations is a journey. This exploration peaks into the process of refactoring a monolithic Terraform configuration, transforming it into modular, environment-specific setups.&lt;/p&gt;

&lt;h1&gt;
  
  
  Setting the Stage
&lt;/h1&gt;

&lt;p&gt;A robust understanding of AWS, complemented by proficiency in the AWS CLI and Terraform CLI, laid the groundwork. This endeavor aimed not just at deploying infrastructure but doing so with precision and scalability.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Monolithic Configuration
&lt;/h1&gt;

&lt;p&gt;The initial configuration mirrored a typical monolith – a single Terraform project handling multiple environments with a shared state file. While suitable for small projects, this approach quickly becomes unwieldy with growing complexity.&lt;/p&gt;

&lt;h1&gt;
  
  
  Applying the Monolith
&lt;/h1&gt;

&lt;p&gt;Provisioning two instances of a web application in separate AWS environments seemed convenient initially. The deployment, orchestrated by a main.tf file, marked the starting point of the journey.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Hidden Dependencies
&lt;/h1&gt;

&lt;p&gt;Modifying seemingly isolated resources triggered a cascade effect, exposing the intricacies of hidden dependencies. This unintended consequence underscored the importance of anticipating impacts in a monolithic setup.&lt;/p&gt;

&lt;h1&gt;
  
  
  Separate States - A Necessary Pivot
&lt;/h1&gt;

&lt;p&gt;To mitigate challenges posed by hidden dependencies, exploring methods to separate states became imperative. Two primary methods, directory separation, and workspaces, were considered.&lt;/p&gt;

&lt;h1&gt;
  
  
  Directory Separation
&lt;/h1&gt;

&lt;p&gt;Organizing environments into separate directories reduced the risk of interference, granting each environment autonomy with its Terraform configurations and state file.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Turning Point
&lt;/h1&gt;

&lt;p&gt;The decision to reorganize marked a turning point. The development and production environments, each with its directory structure, allowed for a more controlled and manageable approach.&lt;/p&gt;

&lt;h1&gt;
  
  
  Separated Deployments
&lt;/h1&gt;

&lt;p&gt;With environments organized into directories, applying changes became focused and controlled. The infrastructure was deployed separately for development and production, showcasing the power of isolation.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Epilogue - Infrastructure Destruction
&lt;/h1&gt;

&lt;p&gt;A necessary part of any IaC journey is the ability to tear down what was built. Infrastructure destruction became a key act, ensuring a clean slate for further exploration.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This expedition, unraveling the monolith, provided insights into the challenges and advantages of restructuring Terraform configurations. The separation of states and configurations empowers better control, paving the way for more scalable and robust IaC practices.&lt;/p&gt;

&lt;h1&gt;
  
  
  Project Origin: A Transparent Insight
&lt;/h1&gt;

&lt;p&gt;It's crucial to note that this project drew inspiration from a &lt;a href="https://developer.hashicorp.com/terraform/tutorials/modules/organize-configuration"&gt;Terraform tutorial&lt;/a&gt;, serving as a foundational guide. While rooted in the tutorial, the journey expanded beyond its confines, incorporating customizations, troubleshooting, and optimizations.&lt;/p&gt;

&lt;h1&gt;
  
  
  Click on these
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/n-e-heath/monolith-reconfig"&gt;Project Repo&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/neheath/"&gt;LinkedIn&lt;/a&gt;&lt;br&gt;
&lt;a href="https://resume.ne-heath.com"&gt;My Website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>aws</category>
      <category>monolith</category>
      <category>modules</category>
    </item>
    <item>
      <title>AWS Cloud Resume Challenge: My First Project</title>
      <dc:creator>N Heath</dc:creator>
      <pubDate>Mon, 01 Jan 2024 07:27:54 +0000</pubDate>
      <link>https://forem.com/neheath/aws-cloud-resume-challenge-my-first-project-1j93</link>
      <guid>https://forem.com/neheath/aws-cloud-resume-challenge-my-first-project-1j93</guid>
      <description>&lt;p&gt;I came upon the &lt;a href="https://cloudresumechallenge.dev/"&gt;Cloud Resume Challenge&lt;/a&gt; by Forrest Brazeal when I was trying to research projects to do to showcase some skills picked up from acquiring the AWS SAA certification. And honestly, this challenge/project was perfect for me. I first studied for cloud certs by going through Coursera courses. While these courses are great, I knew the hands on labs provided were not going to give me the level of proficiency I desire. &lt;/p&gt;

&lt;p&gt;The challenge can be done across multiple cloud providers. I ended up going with AWS to match the new cert. The steps include:&lt;/p&gt;

&lt;p&gt;-&lt;strong&gt;Become Certified:&lt;/strong&gt; This was already on my agenda like I said.  I primarily used Coursera, ACloudGuru, TutorialDojo practice exams, and lots and lots of YouTube.&lt;br&gt;
-&lt;strong&gt;HTML &amp;amp; CSS:&lt;/strong&gt; I didn't want to waste too much time trying to make this perfect just yet because although its the face of the project, it's the not the focus of the challenge. I believe I just googled "portfolio website template", found one that kind of did the job, and did some moderate tweaking. Hopefully I come back and make it look better.&lt;br&gt;
-&lt;strong&gt;S3 Bucket:&lt;/strong&gt; S3 is used to store all of the website files and is perfect for accessibility and scalability. This step was probably the easiest.&lt;br&gt;
-&lt;strong&gt;HTTPS &amp;amp; DNS:&lt;/strong&gt; In order for my S3 bucket to be more secure and use HTTPs, I had to route traffic through Amazon CloudFront first. I additionally bought my very own domain like a big boy! I doubt I am  the only one that instantly thought of 5 better names after it was too late but it is still better than CloudFront's URL. Here is where I also used AWS Certificate Manager (ACM) for the SSL certificate used by the CF distro.&lt;br&gt;
-&lt;strong&gt;JavaScript Visitor Counter:&lt;/strong&gt; I was familiar with JS enough to put this together but not setting up CORS was an issue for a hot minute.&lt;br&gt;
-&lt;strong&gt;DynamoDB &amp;amp; API &amp;amp; Lambda:&lt;/strong&gt; I used Amazon's DynamoDB for storing the visitor count data. Created an API so my JavaScript code can communicate with the db. Lambda, triggered by my API, reads from the DynamoDB table and updates it as well. I had to play with the Python a bit for my Lambda function to properly work. &lt;br&gt;
-&lt;strong&gt;Infrastructure as Code:&lt;/strong&gt; Cloud engineers aren't supposed to be clicking around in consoles wasting company time all day. Instead, they define all their resources in a single file that enables repeatable and consistent deployments... This was terrifying for me. Before I even attempted it, I thought IaC was too difficult and something that I wasn't supposed to be messing with yet. Nonetheless, the challenge continued. I went back and forth between AWS SAM and TerraForm and ultimately decided SAM was the better foot in the door. After loads of mistakes and problem-solving, I got my backend up and running with a functioning YAML file and minimal aws-management-console clicking. &lt;br&gt;
-&lt;strong&gt;Source Control &amp;amp; CI/CD:&lt;/strong&gt; Separate GitHub repos for frontend and backend enable better organization and version control. Continuous integration and deployment are achieved via GitHub actions and help automate testing and deployment for any changes.&lt;/p&gt;

&lt;p&gt;This challenge pushed me way out of my comfort zone and gave me a lot of confidence as I transition from military to the "cloud".&lt;/p&gt;

&lt;p&gt;Check out my &lt;a href="https://resume.ne-heath.com"&gt;resume&lt;/a&gt; and add another site view!&lt;/p&gt;

&lt;p&gt;Connect with me on &lt;a href="https://www.linkedin.com/in/neheath/"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Peak through my GitHub &lt;a href="https://github.com/n-e-heath"&gt;repos&lt;/a&gt; if youre sad and want to feel better about yourself.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>serverless</category>
      <category>resume</category>
    </item>
  </channel>
</rss>
