• About Us
    • New York
  • Work
  • Capabilities
  • Careers
  • Technology
  • Blog
  • Contact Us
  • About Us
    • New York
  • Work
  • Capabilities
  • Careers
  • Technology
  • Blog
  • Contact Us
December 20, 2018

A Beginner’s Experience with Terraform

Posted by Jamie Barbosa

Before I dive into to Terraform and all its power, I want to make it clear how little I knew about infrastructure before I started working with Terraform and AWS. On our team here at PMG, we like to have everyone be as full-stack as possible so that you’re able to understand what’s going on within a specific tool whether it be infrastructure or frontend related. This forces us to learn new things all the time, which is awesome.

After becoming pretty comfortable with understanding the codebases I work on and the logic behind it all, it was time to learn some foundational infrastructure. I had spent time in AWS and poked around a bit, knowing in general what services we used and what they were used for but I would say my knowledge level was a solid 4/10. I was tasked with all sorts of infrastructure issues, mostly related to alerting/notifications and setting up auto-scaling groups.

Some of our tools already had some sort of Terraform foundation before I started so I was able to use the existing stuff as a resource, which was pretty helpful. Some of my tasks were easier than others so I decided to tackle the smaller ones first to dip my toes.

Getting Started with Terraform

There were a few things that were helpful before writing any Terraform stuff. First off, I made sure that I was familiar with the relationships between AWS services, IAM roles and IAM policies. This is the basis of permissions in AWS and knowing how to grant permissions to a service is crucial when working with AWS. Next, I browsed through the existing Terraform modules in our code base and challenged myself to map them back to their services in AWS.


Pro-tip: Before you make any new changes, try to reproduce the existing modules with little guidance. Terraform plan-ing your attempt should not have any changes to apply and should match the current, existing state.


Jumping in, I had to refresh my python skills so that I could write lambda functions for the alerts and notifications. I was able to successfully set up a few different alarms that were triggered by critical application events as well as helpful and friendly notifications for auto-scaling changes. This truly gave us useful insight into our application and the current state that now allows us to manage the application better and prevent errors from occurring.

Learnings

So what did I learn from this whole journey? AWS is complex, so working with Terraform has a steep learning curve that requires a solid foundation of AWS knowledge. Also, making infrastructure changes may seem scary and unfamiliar at first, but Terraform allows you to organize your application state into files that make sense to you. This means that you can have all of your IAM roles and policies in one place while your services are in another. This becomes super useful as your application grows.

Lastly, lambda functions are just incredible and the possibilities are endless. Want slack alerts for when a service goes down? Done. Want to track metrics and their usage? Done. It’s awesome.

To wrap up, I’ll leave you with some helpful tips for your first Terraform-ing adventure:

  • Become familiar with AWS first, know the terms, know what things do, and how they work to connect together.
  • Always plan before applying any changes. Terraform plan will show any immediate issues that you’ll be able to fix before making any real changes.
  • Separate and organize your Terraform files in a way that makes sense to you and your application.
  • Start by replicating a few pieces of your existing infrastructure before making changes.
  • The best way to learn is by doing. Pick what you want to build and go for it!

Happy coding!

data infrastructureDevelopmentHow-Toprogrammingsoftware developmentterraform
Previous
Next

Latest White Papers

  • Shifting Plans for 2020 & Beyond
  • Game On: How Brands Can Log Into A Diverse Multi-Billion Dollar Industry
  • What CCPA Means For Brands
  • How Google is Improving Consumer Data Privacy
  • Ways to Prepare for the Cookieless Future
  • See all White Papers

Featured Posts

  • Ad Age Names PMG #1 Best Place to Work in 2021
  • Hindsight 2020 & Looking Ahead to 2021
  • Preparing for Streaming’s Growth & The Future of TV Buying
  • MediaPost Names PMG Independent Agency of the Year
  • PMG Client Portfolio Trends During Amazon Prime Day 2020

Categories

  • Consumer Insights
  • Content
  • Creative Design
  • Data Analytics
  • Development
  • Digital TV & Video
  • Ecommerce
  • Industry News
  • Local
  • Mobile
  • Paid Search
  • PMG Culture
  • Programmatic & Display
  • SEO
  • Social Media
  • Structured Data
Fort Worth

2845 West 7th Street
Fort Worth, TX 76107

Dallas

3102 Oak Lawn Avenue
Suite 650
Dallas, TX 75219

Austin

823 Congress Avenue
Suite 800
Austin, TX 78701

London

33 Broadwick Street
London
W1F 0DQ

New York

120 East 23rd Street
New York, NY 10010

Get in touch

(817) 420 9970
info@pmg.com

Subscribe to the PMG Newsletter
© 2021 PMG Worldwide, LLC, All Rights Reserved
  • Contact
  • Privacy Policy
 Tweet
 Share
 Tweet
 Share
 Tweet
 Share
 LinkedIn
We and our partners use cookies to personalize content, analyze traffic, and deliver ads. By using our website, you agree to the use of cookies as described in our Cookie Policy.