<?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: Adrián GM</title>
    <description>The latest articles on DEV Community by Adrián GM (@adriangmweb).</description>
    <link>https://dev.to/adriangmweb</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%2F162069%2Fe701acc0-6ac4-4ef1-a9dc-b369e955af0c.jpeg</url>
      <title>DEV Community: Adrián GM</title>
      <link>https://dev.to/adriangmweb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adriangmweb"/>
    <language>en</language>
    <item>
      <title>Understanding infrastructure as code</title>
      <dc:creator>Adrián GM</dc:creator>
      <pubDate>Thu, 22 Oct 2020 15:48:57 +0000</pubDate>
      <link>https://dev.to/theagilemonkeys/understanding-infrastructure-as-code-2lhj</link>
      <guid>https://dev.to/theagilemonkeys/understanding-infrastructure-as-code-2lhj</guid>
      <description>&lt;h1&gt;
  
  
  What is Infrastructure as code? / Where is it coming from?
&lt;/h1&gt;

&lt;p&gt;To understand what Infrastructure as Code (&lt;strong&gt;IaC&lt;/strong&gt;) is, we need to understand first where it’s coming from, and why it was created.&lt;/p&gt;

&lt;h2&gt;
  
  
  How things were before.
&lt;/h2&gt;

&lt;p&gt;Traditionally, when managing the applications server infrastructure, the first step is to design the most suitable architecture for your application, i.e: a simple server to host your application and a database to store the data.&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%2F7tvlhn3kzmzrcdejn4nh.jpg" 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%2F7tvlhn3kzmzrcdejn4nh.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After choosing a provider, everything has to be created and set up manually on the go. Buying the servers, connecting to them, installing or updating the missing dependencies to get it up to date and ready to use, uploading and configuring the app, etc. &lt;/p&gt;

&lt;p&gt;Ideally, this whole process should be well documented in an understandable way, so any engineer should be able to replicate it in case of need. But unfortunately, that is not always the case.&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%2Fbeozmmi208ae3ye2dr3v.jpg" 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%2Fbeozmmi208ae3ye2dr3v.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Imagine that after a few months you have a couple of hundred users using your product, and you get really scared when realizing new functionalities into production because guess what? Sometimes it breaks! And the system is down for a couple of hours. &lt;/p&gt;

&lt;p&gt;The solution would be to create a new environment exactly like production but with no users access, just for developers to try and debug new features. But this means to get another server, set it up manually, deploying the application, etc. And guess what? that takes a lot of time!&lt;/p&gt;

&lt;p&gt;Or maybe just want to: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Upgrade your server dependencies to avoid security issues&lt;/li&gt;
&lt;li&gt;Fix a bug&lt;/li&gt;
&lt;li&gt;Add a new library/dependency &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This process becomes a pain because there is no way you can change your configuration easily. You might think, “well, there is a document that explains how to set up a server so it shouldn’t be as painful or time-consuming as the first time”, in theory, that’s right but… &lt;/p&gt;

&lt;p&gt;Maybe the app has changed so much after those months that it requires different dependencies or versions that are not in the documentation, or is written in a specific language that is not easy to understand for other team members, or even there might not be any document at all!&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%2Ffgfawu726m0z0wdtdv4e.jpg" 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%2Ffgfawu726m0z0wdtdv4e.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  But there is a light at the end of the tunnel
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Infrastructure as code&lt;/strong&gt; comes as the solution to all those cases forehead mentioned.: the architecture configuration is code-written in files that will be uploaded to an interpreter service, that will create all those resources for you programmatically.&lt;/p&gt;

&lt;p&gt;So in this case, you also start with the first step of thinking about your application architecture design, but the second step is very different. &lt;/p&gt;

&lt;p&gt;After choosing a provider, you create some template files compatible with the provider’s interpreter service. Once your architecture definition has been written you just need to upload it to the interpreter service, and it will take care of deploying and configuring all those services for you.&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%2F9a9icooiamaaathit3yk.jpg" 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%2F9a9icooiamaaathit3yk.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once everything is set, you can upload your code separately but there are interesting tools to deploy your code in the process, so you can deploy all at once.&lt;/p&gt;

&lt;p&gt;This provides the possibility of creating new environments easily from the same piece of code, that will be identical to the production environment to be able to debug an error or try out new features. Furthermore, those files are usually stored in a version control system, so all the team can have access and be synchronized and it gets really easy to roll back to a previous configuration if you want to get rid of an issue you didn’t spot before or just ditch a change.&lt;/p&gt;

&lt;p&gt;Many cloud providers offer this option to manage their services, i.e: &lt;a href="https://dev.to/boostercloud/explaining-the-hype-around-booster-framework-3cf2"&gt;AWS CloudFormation&lt;/a&gt;, &lt;a href="https://azure.microsoft.com/features/resource-manager/" rel="noopener noreferrer"&gt;Azure Resource Manager&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This has opened the market for &lt;strong&gt;“provider-agnostic”&lt;/strong&gt; tools such as &lt;a href="https://serverless.com/" rel="noopener noreferrer"&gt;Serverless Framework&lt;/a&gt; and &lt;a href="https://www.terraform.io/" rel="noopener noreferrer"&gt;Terraform&lt;/a&gt; that allows you to write your infrastructure code &lt;strong&gt;once&lt;/strong&gt;, and it will be translated into &lt;strong&gt;any provider&lt;/strong&gt; you want to deploy to! 🤯 &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%2Fk9xhks6v6emlispkrwwk.jpeg" 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%2Fk9xhks6v6emlispkrwwk.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  In conclusion
&lt;/h3&gt;

&lt;p&gt;Teams who adopt &lt;strong&gt;IaC&lt;/strong&gt; are able to build, deploy and replicate faster and more trustable environments where the &lt;em&gt;“it works in staging but it fails in production”&lt;/em&gt; situations are not in the table anymore.&lt;/p&gt;

&lt;p&gt;That’s what we do in &lt;a href="https://www.theagilemonkeys.com/" rel="noopener noreferrer"&gt;The Agile Monkeys&lt;/a&gt;, we always bet for the most trustable and resilient technologies, to maximize the quality of everything we build.&lt;/p&gt;

&lt;p&gt;We really encourage you to step into the &lt;strong&gt;IaC&lt;/strong&gt; world if you're interested in DevOps, it is really a game-changer!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>serverless</category>
      <category>beginners</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
