<?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: Aron Johnson</title>
    <description>The latest articles on Forem by Aron Johnson (@aronjohnson).</description>
    <link>https://forem.com/aronjohnson</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%2F401401%2Fc94c136c-b0b9-4039-ab1a-fd9a967d93f8.jpg</url>
      <title>Forem: Aron Johnson</title>
      <link>https://forem.com/aronjohnson</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/aronjohnson"/>
    <language>en</language>
    <item>
      <title>How We Use Infrastructure as Code in HarperDB Cloud</title>
      <dc:creator>Aron Johnson</dc:creator>
      <pubDate>Tue, 20 Oct 2020 18:13:42 +0000</pubDate>
      <link>https://forem.com/harperfast/how-we-use-infrastructure-as-code-in-harperdb-cloud-41mh</link>
      <guid>https://forem.com/harperfast/how-we-use-infrastructure-as-code-in-harperdb-cloud-41mh</guid>
      <description>&lt;h2&gt;
  
  
  Why Infrastructure as Code?
&lt;/h2&gt;

&lt;p&gt;Earlier this year we launched &lt;a href="https://harperdb.io/harperdb-cloud-get-started-today" rel="noopener noreferrer"&gt;HarperDB Cloud&lt;/a&gt;, a fully-managed, cloud-hosted version of HarperDB. We wanted HarperDB Cloud to be a fast and low-friction way to get HarperDB. &lt;a href="https://studio.harperdb.io/sign-up" rel="noopener noreferrer"&gt;Sign up&lt;/a&gt;, answer a couple of questions, and a few minutes later you have a working instance of HarperDB. To make this happen, we understood that all aspects of deploying the infrastructure to host customer workloads must be automated. In other words, we needed to leverage Infrastructure as Code (IaC.) &lt;/p&gt;

&lt;h2&gt;
  
  
  What is Infrastructure as Code?
&lt;/h2&gt;

&lt;p&gt;Traditionally, the deployment of IT infrastructure (creating virtual machines and installing applications, provisioning storage and networking, etc.) was largely a manual effort. Meaning, IT administrators would use a series of CLI and GUI tools, maybe some scripts, to build and configure each piece of the infrastructure. This way of building infrastructure is very inefficient and prone to error. IaC is the response to these challenges. &lt;/p&gt;

&lt;p&gt;IaC is a method of defining a set of infrastructure components in one or more configuration files (usually in the form of YAML, JSON, or a similar format), which are then passed to an IaC software tool (such as HashiCorp &lt;a href="https://www.terraform.io/" rel="noopener noreferrer"&gt;Terraform&lt;/a&gt; or AWS &lt;a href="https://aws.amazon.com/cloudformation/" rel="noopener noreferrer"&gt;CloudFormation&lt;/a&gt;) that will provision those components on a cloud platform. IaC allows infrastructure to be built in a fast, consistent, and repeatable fashion!&lt;/p&gt;

&lt;h2&gt;
  
  
  How and Why We Use CloudFormation
&lt;/h2&gt;

&lt;p&gt;HarperDB Cloud consists of:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;HarperDB Studio, our hosted application for managing your HarperDB instances.&lt;/li&gt;
&lt;li&gt;AWS Lambda functions that build AWS resources for running customer workloads (the functions also do various other things, such as update our payment and CRM platforms.)&lt;/li&gt;
&lt;li&gt;The AWS resources that run customer workloads, such as VPCs, EC2 Instances, EBS Volumes, Elastic Load Balancers, etc.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Lambda functions use CloudFormation to build AWS resources. Sure, we could call the individual AWS APIs for VPC, EC2, Route53, etc. to build each of these resources, but we would have to create the logic to deal with resource dependencies (wait to build this until that is built) and rollback when a resource fails to build (that EC2 instance doesn't do any good if there is not a related ELB rule.) An IaC tool like CloudFormation takes care of all that, and more, for us! 😁&lt;/p&gt;

&lt;h2&gt;
  
  
  What About Terraform?
&lt;/h2&gt;

&lt;p&gt;There are lots of great IaC tools besides CloudFormation out there. We currently only place HarperDB Cloud customer workloads on AWS, and we already use AWS services for the other backend parts of HarperDB Cloud (&lt;a href="https://dev.to/davidcockerill"&gt;David&lt;/a&gt; has an &lt;a href="https://dev.to/harperdb/how-we-build-and-deploy-our-serverless-harperdb-studio-backend-application-52cg"&gt;excellent article&lt;/a&gt; for more about that), so using the AWS-native IaC tool made sense. Don't worry all you HashiCorp fans out there, we use and love HashiCorp tools (we use &lt;a href="https://www.packer.io/" rel="noopener noreferrer"&gt;Packer&lt;/a&gt; to automate the build of all our Amazon Machine Images), so of course we considered using Terraform! CloudFormation and Terraform each have different strengths, but either IaC tool would work.&lt;/p&gt;

&lt;h2&gt;
  
  
  With a Little Help From Systems Manager Automation
&lt;/h2&gt;

&lt;p&gt;While CloudFormation is awesome at provisioning and terminating AWS resources, the management of existing infrastructure, particularly the guest OS and applications of an instance, often requires another tool. Need to patch Linux, then upgrade HarperDB, and make a configuration change, to hundreds of EC2 instances, in just a few minutes? AWS &lt;a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-automation.html" rel="noopener noreferrer"&gt;Systems Manager (SSM) Automation&lt;/a&gt; can make that happen! Yup, there are other great tools for doing this kind of work (&lt;em&gt;Cough! Ansible. Cough!&lt;/em&gt;), but SSM Automation works great for us.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;This technology stack works great for us, but what's next? Lots! You probably noticed that I said a few icky words like "EC2 instance" and "patch," but I didn't mention "containers" or "immutable infrastructure." Well, don't worry, we are making plans. Also, it now seems likely we will have customer demand to host HarperDB Cloud workloads on cloud platforms other than AWS. Hmm, about that Terraform thing... 😅&lt;/p&gt;

&lt;p&gt;If you are interested, &lt;a href="https://dev.to/margo_hdb"&gt;Margo&lt;/a&gt; has a &lt;a href="https://dev.to/harperdb/building-a-database-written-in-node-js-from-the-ground-up-2hgm"&gt;great article&lt;/a&gt; about what makes HarperDB different and special. Also, you can &lt;a href="https://harperdb.io/harperdb-cloud-get-started-today/" rel="noopener noreferrer"&gt;try out HarperDB&lt;/a&gt;, for free!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>iac</category>
      <category>cloudformation</category>
    </item>
  </channel>
</rss>
