Codementor Events

Benefits of Infrastructure as Code and General Tips

Published Jun 04, 2019
Benefits of Infrastructure as Code and General Tips
In my first year as a cloud developer I was thrown into the fire. In a devops 
world, you are expected to know how to deploy, debug, and develop your own 
infastructure for your microservices. "Infastructure as Code" is the idea that
in a cloud setting you should be writing source code to declare your 
environment and its default configuration. This gives you the benefit of 
reproducability between environments, and allows you to hook up your state 
declarations to source control for easy diffing and versioning. 

This is a topic that is largerly NOT covered in a typical four year University 
program. One of the challenges of leaning IaC when you first start is that you 
typically also need to learn how to use the associated cloud providers 
platform and terminology. One tip I have for those of you learning IaC would 
be to first develop your infastructure in a test environment by looking at the 
GUI's provided by your cloud provider. In my case this meant studying the AWS 
console for various service configurations, and writing down the potential 
fields and their options. In AWS, you can even generate your infastructure 
code (Cloud Formation) from you gui selections. 

There are a few languages that support multiple cloud providers; terraform is
a popular one. One disadvantage to these types of languages is that you lose
the generation functionality of the provider. There are tools that help with
this: https://github.com/humanmade/cf-to-tf. I would recommend getting
familiar with the code syntax on some level, incase you ever need to make
edits. Terraform has its own gotchas you can learn about here:
https://blog.gruntwork.io/terraform-tips-tricks-loops-if-statements-and
gotchas-f739bbae55f9?gi=762db022e8ab. 

I highly recommend creating a free tier account in AWS or Google before 
starting your first job. If you come in with even a basic understanding of the 
concept of infastructure as code and the basic cloud services offered by these 
companies, you will be ahead of most of your peers. It is an essential skill 
of developers working in cloud first environments, and is in high demand in 
the workplace now. 

If you want more indepth suggestions, code reviews, or cloud related questions, sign up for a session with me!

Discover and read more posts from Joseph Jay
get started
post commentsBe the first to share your opinion
Show more replies