Using Terraform to automate everything — from Dominos to Slack

Automating your ticket queue with self-service Terraform repos works for more use cases than you might think.

https://www.istockphoto.com/portfolio/imaginima
  • Enable non-administrators to create the above-mentioned primitives, but watch as untrained users create objects without concern for naming conventions or best practices. Pretty soon, the system is mired in thousands of unused objects, and it is a struggle to make sense of it all.
  • Restrict permissions to administrators and then get flooded with hundreds of tickets from users asking you to change settings. Before long, the administrators are just button smashers, absolutely dreading their support rotations.
  • Source Control: Automate your GitHub teams, organizations, and repository settings.
  • Authentication: Create users and groups, populate membership, and set up SAML integrations.
  • Learning Platforms: Create course definitions, content, and assignments.
  • Ticketing Platforms: Standardize project settings, templates, workflows, and assignments.
  • Vulnerability Management: Manage assets, define scans, and create vulnerability exceptions.
  • Knowledge Platforms: Create folder structures, templates, and permission structures.

Everything-as-code

  • A free GUI — GitHub/GitLab/Bitbucket is the world’s best WYSIWYG platform.
  • Declarative state — Tickets exist in isolation. Terraform defines the entire state.
  • Minimization of back-and-forth information gathering — Use CI to provide rapid feedback before getting a human involved.
  • Peer review — Allow multiple people to collaborate before making a decision. This is great for the longevity and security of a system.
  • Self-service — Using tools like policybot and bulldozer, you can make the entire workflow hands-off.

A free GUI

  • authentication and authorization fundamentals,
  • data visualization and modification tools,
  • input validation and user feedback,
  • audit trails, and, most importantly,
  • a dark theme.

Declarative state

Minimization of back-and-forth information gathering with CI

Peer review

Self-service

  1. Low risk — Allow a user to fulfill their own needs.
  2. Medium risk — Allow a user to fulfill their needs with the help of a teammate who reviews their requests.
  3. High risk — Allow a user to submit a request, but only the DevOps or security team can approve it.
  • unit tests to block commits that violated business standards,
  • policybot to only allow cases (A) and (B) for a limited set of files, and
  • bulldozer to merge PRs on their behalf (not granting anyone write permissions).

Can less-technical users make pull requests?

From Eleonora and Francescoc

So why Terraform instead of something like Go+YML?

  • reconciling the desired versus actual state,
  • having modules that greatly simplifying inputs while still being traceable,
  • creating clean(ish) output for each of the automation phases,
  • including built-in mechanics for secret management,
  • supporting the validation of the desired or end state (Sentinel), and most importantly,
  • many enterprise and SAAS companies already support Terraform as their configuration language.

Wrap-up

Want to connect?You can find me on LinkedIn.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Elliot Graebert

Former Head of Internal Cloud at Palantir, Infrastructure and Security Nerd, Gamer, Dad