SlideShare a Scribd company logo
Copyright © 2019 HashiCorp
Everything as Code with
Terraform
All Things Open | October 14, 2019
Everything as Code with Terraform
Everything as Code with Terraform
“I can’t stand using this interface to
paste all of these code snippets.”
(Actually 2 years, ~20 blogs, and slightly more wisdom later…)
“Oh, I can build a Terraform provider that
reads Markdown and sends it up to
Medium.”
“Blog-as-Code”
Agenda Infrastructure-as-Code
Terraforming the Datacenter
Extending Terraform
Writing a Provider
Everything-as-Code
Or Get Close
8
hashi.co/2019-ato
Infrastructure-as-Code
Terraforming the Datacenter
10
Infrastructure-as-Code Goals
▪ Unify the view of resources
▪ Support the modern data center (IaaS, PaaS, SaaS)
▪ Expose a way for individuals and teams to safely and predictably
change infrastructure
▪ Provide a workflow that is technology agnostic
▪ Manage anything with an API
11
“I don’t know how to code. But I do want
to automate how I configure my
infrastructure.”
- An Infrastructure Engineer Who Started Using Public Cloud
12
“It was hard enough for me to learn
infrastructure terms but writing code for
it too? Difficult.”
- A Developer Who Started Using Public Cloud
13
Terraform
HashiCorp Configuration
Language
CODE EDITOR
resource "google_compute_instance" "default" {
name = "test"
machine_type = "n1-standard-1"
zone = "us-central1-a"
tags = ["foo", "bar"]
boot_disk {
initialize_params {
image = "debian-cloud/debian-9"
}
}
// Local SSD disk
scratch_disk {
}
network_interface {
network = "default"
access_config {
// Ephemeral IP
}
14
Extensible &
Idempotent
CODE EDITOR
resource "datadog_monitor" "foo" {
name = "Name for monitor foo"
type = "metric alert"
message = "Monitor triggered. Notify: @hipchat-
channel"
escalation_message = "Escalation message @pagerduty"
query = "avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo}
by {host} > 4"
thresholds = {
ok = 0
warning = 2
warning_recovery = 1
critical = 4
critical_recovery = 3
}
notify_no_data = false
renotify_interval = 60
15
TERMINAL
+ resource will be created

- resource will be destroyed

~ resource will be updated in-place

-/+ resources will be destroyed and re-created
16
Infrastructure-as-Code
github.com/joatmon08/2019-demo-ato
18
terraform.io/docs/providers/
Extending Terraform
Writing a Provider
19
terraform.io/docs/extend/how-terraform-works.html
Let’s build a provider.
github.com/joatmon08/2019-demo-ato
Useful Resources
▪ Writing Custom Providers - official documentation
▪ Plugin SDK - now officially separated from core
▪ Creating a Terraform Provider for Just About Anything by Eddie
Zanewski
▪ Check out other providers like AWS or GCP!
Everything-as-Code
Or Get Close
23
Terraform
Provider for
Medium
github.com/joatmon08/
terraform-provider-
medium
CODE EDITOR
resource "medium_image" "draft" {
  file_path    = "./images/draft.png"
  content_type = "image/png"
}
resource "medium_post" "my-post" {
  title          = "Writing a Terraform Medium Provider"
  content        = templatefile("./
content.md", { image_url = medium_image.draft.url })
  content_format = "markdown"
  publish_status = "draft"
  tags           = ["terraform", "medium", "automation"]
}
Tips for Building _______-as-Code
▪ Non-ideal upstream APIs
– Read-only provider
– Write your own client
▪ Testing
– Express functionality in acceptance tests
– Examine interface changes with contract tests
Alerts-as-Code?
Datadog
Grafana
PagerDuty
To Do-as-Code?
Google Calendar
G Suite
Todoist

(link)
Life-as-Code?
Meetup 

(community-as-code)

Domino’s Pizza

(pizza-as-code)

Pokémon

(catch 'em-all-as-code)
“I like your blog but we don’t speak
much English.
Do you have translations?”
27
Everything as Code with Terraform
Translated Blog-as-Code
github.com/joatmon08/2019-demo-ato
“Doing Better”-through-Code
30
speakerdeck.com/joatmon08/everything-as-code-with-terraform
Rosemary Wang (she/her)
Developer Advocate at HashiCorp
@joatmon08
joatmon08
linkedin.com/in/rosemarywang/
31

More Related Content

What's hot (20)

PDF
Monitoring with prometheus
Kasper Nissen
 
PPTX
Terraform
Phil Wilkins
 
PDF
Terraform -- Infrastructure as Code
Martin Schütte
 
PDF
Terraform 0.12 + Terragrunt
Anton Babenko
 
PPTX
02 terraform core concepts
zekeLabs Technologies
 
PDF
Terraform introduction
Jason Vance
 
PDF
Hashicorp Vault: Open Source Secrets Management at #OPEN18
Kangaroot
 
PPTX
Terraform
Pathum Fernando ☁
 
PPTX
Comprehensive Terraform Training
Yevgeniy Brikman
 
PDF
A Hands-on Introduction on Terraform Best Concepts and Best Practices
Nebulaworks
 
PDF
Terraform modules and (some of) best practices
Anton Babenko
 
ODP
Monitoring With Prometheus
Knoldus Inc.
 
PDF
Terraform
Marcelo Serpa
 
PDF
Terraform Introduction
soniasnowfrog
 
PPTX
Prometheus design and philosophy
Docker, Inc.
 
PPTX
Terraform
Adam Vincze
 
PDF
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
Flink Forward
 
PDF
Introducing Vault
Ramit Surana
 
PDF
Terraform
Christophe Marchal
 
PPTX
Grafana
NoelMc Grath
 
Monitoring with prometheus
Kasper Nissen
 
Terraform
Phil Wilkins
 
Terraform -- Infrastructure as Code
Martin Schütte
 
Terraform 0.12 + Terragrunt
Anton Babenko
 
02 terraform core concepts
zekeLabs Technologies
 
Terraform introduction
Jason Vance
 
Hashicorp Vault: Open Source Secrets Management at #OPEN18
Kangaroot
 
Comprehensive Terraform Training
Yevgeniy Brikman
 
A Hands-on Introduction on Terraform Best Concepts and Best Practices
Nebulaworks
 
Terraform modules and (some of) best practices
Anton Babenko
 
Monitoring With Prometheus
Knoldus Inc.
 
Terraform
Marcelo Serpa
 
Terraform Introduction
soniasnowfrog
 
Prometheus design and philosophy
Docker, Inc.
 
Terraform
Adam Vincze
 
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
Flink Forward
 
Introducing Vault
Ramit Surana
 
Grafana
NoelMc Grath
 

Similar to Everything as Code with Terraform (20)

PPTX
Infrastructure as code, using Terraform
Harkamal Singh
 
PDF
Infrastructure as Code with Terraform
Pedro J. Molina
 
PDF
Terraform In Action Meap V10 Meap Scott Winkler
heyenpardis0
 
PPTX
Chicago Hashicorp User Group - Terraform Public Module Registry
Stenio Ferreira
 
PDF
Do the Cloud right - How to start your journey
Gwenn Etourneau
 
PDF
GDG Cloud Southlake #8 Steve Cravens: Infrastructure as-Code (IaC) in 2022: ...
James Anderson
 
PPTX
Infrastructure as Code with Terraform.pptx
Samuel862293
 
PDF
Inrastructure as Code
Charles Anderson
 
PDF
CDK Meetup: Rule the World through IaC
smalltown
 
PPTX
DevOps: Infrastructure as Code
Julio Aziz Flores Casab
 
PDF
Terraform 0.12 Deep Dive: HCL 2.0 for Infrastructure as Code, Remote Plan & A...
Mitchell Pronschinske
 
PDF
Infrastructure as Code with Terraform
Tim Berry
 
PPTX
Provision to Production with Terraform Enterprise
Amanda MacLeod
 
PDF
Infrastructure as Code
Albert Suwandhi
 
PDF
Infrastructure as code terraformujeme cloud
ViliamPucik
 
PDF
Terraform: Infrastructure as Code
Pradeep Bhadani
 
PDF
DevOps Fest 2020. immutable infrastructure as code. True story.
Vlad Fedosov
 
PDF
Oracle Cloud - Infrastruktura jako kód
MarketingArrowECS_CZ
 
PDF
Introduction to IAC and Terraform
Venkat NaveenKashyap Devulapally
 
PDF
Infrastructure as Code & Terraform 101
Kristoffer Ahl
 
Infrastructure as code, using Terraform
Harkamal Singh
 
Infrastructure as Code with Terraform
Pedro J. Molina
 
Terraform In Action Meap V10 Meap Scott Winkler
heyenpardis0
 
Chicago Hashicorp User Group - Terraform Public Module Registry
Stenio Ferreira
 
Do the Cloud right - How to start your journey
Gwenn Etourneau
 
GDG Cloud Southlake #8 Steve Cravens: Infrastructure as-Code (IaC) in 2022: ...
James Anderson
 
Infrastructure as Code with Terraform.pptx
Samuel862293
 
Inrastructure as Code
Charles Anderson
 
CDK Meetup: Rule the World through IaC
smalltown
 
DevOps: Infrastructure as Code
Julio Aziz Flores Casab
 
Terraform 0.12 Deep Dive: HCL 2.0 for Infrastructure as Code, Remote Plan & A...
Mitchell Pronschinske
 
Infrastructure as Code with Terraform
Tim Berry
 
Provision to Production with Terraform Enterprise
Amanda MacLeod
 
Infrastructure as Code
Albert Suwandhi
 
Infrastructure as code terraformujeme cloud
ViliamPucik
 
Terraform: Infrastructure as Code
Pradeep Bhadani
 
DevOps Fest 2020. immutable infrastructure as code. True story.
Vlad Fedosov
 
Oracle Cloud - Infrastruktura jako kód
MarketingArrowECS_CZ
 
Introduction to IAC and Terraform
Venkat NaveenKashyap Devulapally
 
Infrastructure as Code & Terraform 101
Kristoffer Ahl
 
Ad

More from All Things Open (20)

PDF
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
PPTX
Big Data on a Small Budget: Scalable Data Visualization for the Rest of Us - ...
All Things Open
 
PDF
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
PDF
Let's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
All Things Open
 
PDF
Leveraging Pre-Trained Transformer Models for Protein Function Prediction - T...
All Things Open
 
PDF
Gen AI: AI Agents - Making LLMs work together in an organized way - Brent Las...
All Things Open
 
PDF
You Don't Need an AI Strategy, But You Do Need to Be Strategic About AI - Jes...
All Things Open
 
PPTX
DON’T PANIC: AI IS COMING – The Hitchhiker’s Guide to AI - Mark Hinkle, Perip...
All Things Open
 
PDF
Fine-Tuning Large Language Models with Declarative ML Orchestration - Shivay ...
All Things Open
 
PDF
Leveraging Knowledge Graphs for RAG: A Smarter Approach to Contextual AI Appl...
All Things Open
 
PPTX
Artificial Intelligence Needs Community Intelligence - Sriram Raghavan, IBM R...
All Things Open
 
PDF
Don't just talk to AI, do more with AI: how to improve productivity with AI a...
All Things Open
 
PPTX
Open-Source GenAI vs. Enterprise GenAI: Navigating the Future of AI Innovatio...
All Things Open
 
PDF
The Death of the Browser - Rachel-Lee Nabors, AgentQL
All Things Open
 
PDF
Making Operating System updates fast, easy, and safe
All Things Open
 
PDF
Reshaping the landscape of belonging to transform community
All Things Open
 
PDF
The Unseen, Underappreciated Security Work Your Maintainers May (or may not) ...
All Things Open
 
PDF
Integrating Diversity, Equity, and Inclusion into Product Design
All Things Open
 
PDF
The Open Source Ecosystem for eBPF in Kubernetes
All Things Open
 
PDF
Open Source Privacy-Preserving Metrics - Sarah Gran & Brandon Pitman
All Things Open
 
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
Big Data on a Small Budget: Scalable Data Visualization for the Rest of Us - ...
All Things Open
 
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
Let's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
All Things Open
 
Leveraging Pre-Trained Transformer Models for Protein Function Prediction - T...
All Things Open
 
Gen AI: AI Agents - Making LLMs work together in an organized way - Brent Las...
All Things Open
 
You Don't Need an AI Strategy, But You Do Need to Be Strategic About AI - Jes...
All Things Open
 
DON’T PANIC: AI IS COMING – The Hitchhiker’s Guide to AI - Mark Hinkle, Perip...
All Things Open
 
Fine-Tuning Large Language Models with Declarative ML Orchestration - Shivay ...
All Things Open
 
Leveraging Knowledge Graphs for RAG: A Smarter Approach to Contextual AI Appl...
All Things Open
 
Artificial Intelligence Needs Community Intelligence - Sriram Raghavan, IBM R...
All Things Open
 
Don't just talk to AI, do more with AI: how to improve productivity with AI a...
All Things Open
 
Open-Source GenAI vs. Enterprise GenAI: Navigating the Future of AI Innovatio...
All Things Open
 
The Death of the Browser - Rachel-Lee Nabors, AgentQL
All Things Open
 
Making Operating System updates fast, easy, and safe
All Things Open
 
Reshaping the landscape of belonging to transform community
All Things Open
 
The Unseen, Underappreciated Security Work Your Maintainers May (or may not) ...
All Things Open
 
Integrating Diversity, Equity, and Inclusion into Product Design
All Things Open
 
The Open Source Ecosystem for eBPF in Kubernetes
All Things Open
 
Open Source Privacy-Preserving Metrics - Sarah Gran & Brandon Pitman
All Things Open
 
Ad

Recently uploaded (20)

PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 

Everything as Code with Terraform