SlideShare a Scribd company logo
Terraform:
Configuration Management for Cloud Services
Martin Schütte
27 April 2016
TERRAFORM
Build,  Combine,  and  Launch  Infrastructure
Concepts
by Rodzilla at Wikimedia Commons (CC-BY-SA-3.0)
From Servers …
Martin Schütte | Terraform | OSDC’16 3/29
…to Services
Martin Schütte | Terraform | OSDC’16 4/29
Services also need Configuration Management
• Replace “click paths” with source code in VCS
• Lifecycle awareness, not just a setup.sh
• Reproducible environments
• Specification, documentation, policy enforcement
Martin Schütte | Terraform | OSDC’16 5/29
Core Ideas in Terraform
• Simple model of resource entities with attributes
• Stateful lifecycle with CRUD operations
• Declarative configuration
• Dependencies by inference
• Parallel execution
Martin Schütte | Terraform | OSDC’16 6/29
Core Concepts in Terraform
• Provider: a source of resources
(usually with an API endpoint & authentication)
• Resource: every thing “that has a set of configurable
attributes and a lifecycle (create, read, update, delete)” –
implies ID and state
• Provisioner: initialize a resource with local or
remote scripts
Martin Schütte | Terraform | OSDC’16 7/29
Core Concepts in Terraform
• Order: directed acyclic graph of all resources
• Plan: generate an execution plan for review
before applying a configuration
• State: execution result is kept in state file
(local or remote)
• Lightweight: little provider knowledge, no error handling
Martin Schütte | Terraform | OSDC’16 8/29
Available services
Providers:
• AWS
• Azure
• Google Cloud
• Heroku
• DNSMadeEasy
• OpenStack
• Docker
• …
Resources:
• aws_instance
• aws_vpc
• aws_elb
• aws_iam_user
• azure_instance
• heroku_app
• …
Provisioners:
• chef
• file
• local-exec
• remote-exec
Martin Schütte | Terraform | OSDC’16 9/29
DSL Syntax
• Hashicorp Configuration Language (HCL),
think “JSON-like but human-friendly”
• Variables
• Interpolation, e. g.
”number ${count.index + 1}”
• Attribute access with resource_type.resource_name
• Few build-in functions, e. g.
base64encode(string), format(format, args…)
Martin Schütte | Terraform | OSDC’16 10/29
HCL vs. JSON
# An AMI
variable ”ami” {
description = ”custom AMI”
}
/* A multi
line comment. */
resource ”aws_instance” ”web” {
ami = ”${var.ami}”
count = 2
source_dest_check = false
connection {
user = ”root”
}
}
{
”variable”: {
”ami”: {
”description”: ”custom AMI”
}
},
”resource”: {
”aws_instance”: {
”web”: {
”ami”: ”${var.ami}”,
”count”: 2,
”source_dest_check”: false,
”connection”: {
”user”: ”root”
}
}
}
}
}
Martin Schütte | Terraform | OSDC’16 11/29
Example: Simple Webservice
Example: Simple Webservice (part 1)
### AWS Setup
provider ”aws” {
access_key = ”${var.aws_access_key}”
secret_key = ”${var.aws_secret_key}”
region = ”${var.aws_region}”
}
# Queue
resource ”aws_sqs_queue” ”importqueue” {
name = ”${var.app_name}-${var.aws_region}-importqueue”
}
# Storage
resource ”aws_s3_bucket” ”importdisk” {
bucket = ”${var.app_name}-${var.aws_region}-importdisk”
acl = ”private”
}
Martin Schütte | Terraform | OSDC’16 12/29
Example: Simple Webservice (part 2)
### Heroku Setup
provider ”heroku” { ... }
# Importer
resource ”heroku_app” ”importer” {
name = ”${var.app_name}-${var.aws_region}-import”
region = ”eu”
config_vars {
SQS_QUEUE_URL = ”${aws_sqs_queue.importqueue.id}”
S3_BUCKET = ”${aws_s3_bucket.importdisk.id}”
}
}
resource ”heroku_addon” ”mongolab” {
app = ”${heroku_app.importer.name}”
plan = ”mongolab:sandbox”
}
Martin Schütte | Terraform | OSDC’16 13/29
terraform graph | dot -Tpdf
aws_s3_bucket.importdisk
provider.aws
aws_sqs_queue.importqueue
heroku_addon.mongolab
heroku_app.importer
provider.heroku
Martin Schütte | Terraform | OSDC’16 14/29
Terraform Process
*.tf override.tfModules
“source” terraform.tfvars
plan
state
get
plan
apply
destroy
Martin Schütte | Terraform | OSDC’16 15/29
Example: Add Provisioning
# Importer
resource ”heroku_app” ”importer” {
name = ”${var.app_name}-${var.aws_region}-import”
region = ”eu”
config_vars { ... }
provisioner ”local-exec” {
command = <<EOT
cd ~/projects/go-testserver &&
git remote add heroku ${heroku_app.importer.git_url} &&
git push heroku master
EOT
}
}
Martin Schütte | Terraform | OSDC’16 16/29
Example: Add Outputs
# Storage
resource ”aws_s3_bucket” ”importdisk” { ... }
# Importer
resource ”heroku_app” ”importer” { ... }
# Outputs
output ”importer_bucket_arn” {
value = ”${aws_s3_bucket.importdisk.arn}”
}
output ”importer_url” {
value = ”${heroku_app.importer.web_url}”
}
output ”importer_gitrepo” {
value = ”${heroku_app.importer.git_url}”
}
Martin Schütte | Terraform | OSDC’16 17/29
Modules
Modules
“Plain terraform code” lacks structure and reusability
Modules
• are subdirectories with self-contained terraform code
• may be sourced from Git, Mercurial, HTTPS locations
• use variables and outputs to pass data
Martin Schütte | Terraform | OSDC’16 18/29
Module Example
Every Terraform directory may be used as a module.
Here I use the previous webservice example.
Martin Schütte | Terraform | OSDC’16 19/29
Using a Module Example (part 1)
module ”importer_west” {
source = ”../simple”
aws_region = ”eu-west-1”
app_name = ”${var.app_name}”
aws_access_key = ”${var.aws_access_key}”
aws_secret_key = ”${var.aws_secret_key}”
heroku_login_email = ”${var.heroku_login_email}”
heroku_login_api_key = ”${var.heroku_login_api_key}”
}
module ”importer_central” {
source = ”../simple”
aws_region = ”eu-central-1”
# ...
}
Martin Schütte | Terraform | OSDC’16 20/29
Using a Module Example (part 2)
# Main App, using modules
resource ”heroku_app” ”main” {
name = ”${var.app_name}-main”
region = ”eu”
config_vars {
IMPORTER_URL_LIST = <<EOT
[ ”${module.importer_west.importer_url}”,
”${module.importer_central.importer_url}” ]
EOT
}
}
output ”main_url” {
value = ”${heroku_app.main.web_url}”
}
Martin Schütte | Terraform | OSDC’16 21/29
Plugins
How to Write Own Plugins
• Learn you some Golang
• Use the schema helper lib
• Adapt to model of
Provider (setup steps, authentication) and
Resources (arguments/attributes and CRUD methods)
Martin Schütte | Terraform | OSDC’16 22/29
Plugin Example
Simple Plugin: MySQL
Implements provider mysql with resource mysql_database.
Code at builtin/providers/mysql 
Martin Schütte | Terraform | OSDC’16 23/29
Usage
Issues
Under active development, current version 0.6.15 (April 22)
• Still a few bugs, e. g. losing state info
• Modules are very simple
• Lacking syntactic sugar
(e. g. aggregations, common repetitions)
General problems for this kind of tool
• Testing is inherently difficult
• Provider coverage
• Resource model mismatch, e. g. with Heroku apps
• Ignorant of API rate limits, account ressource limits, etc.
Martin Schütte | Terraform | OSDC’16 24/29
Comparable Tools
Tools:
• AWS CloudFormation (with generator tools)
• OpenStack Heat
• Azure Resource Manager Templates
Configuration Management:
• SaltStack Salt Cloud
• Ansible v2.0 includes cloud modules
Libraries:
• fog, Ruby cloud abstraction library
• boto, Python AWS library
Martin Schütte | Terraform | OSDC’16 25/29
Workflow
• Use a VCS, i. e. git
• Use PGP to encrypt sensitive data, e. g. with Blackbox
• Use separate user credentials, know how to revoke them
• Take a look at Hashicorp Atlas and its workflow
Martin Schütte | Terraform | OSDC’16 26/29
Hashicorp Workflow
image by Hashicorp Atlas: Artifact Pipeline and Image Deploys with Packer and Terraform
Martin Schütte | Terraform | OSDC’16 27/29
Links and Resources
Defining system infrastructure as code and
building it with tools doesn’t make the quality any
better. At worst, it can complicate things.
— Infrastructure as Code by Kief Morris
• Terraform
• hashicorp/terraform 
• StackExchange/blackbox 
• Terraforming – Export existing AWS resources
• Terraform: Beyond the Basics with AWS
• Terraform, VPC, and why you want a tfstate file per env
Martin Schütte | Terraform | OSDC’16 28/29
The End
Thank You!
Questions?
Martin Schütte
info@martin-schuette.de
slideshare.net/mschuett/ 
Martin Schütte | Terraform | OSDC’16 29/29

More Related Content

PDF
Building infrastructure with Terraform (Google)
PPTX
Terraform Modules and Continuous Deployment
PDF
Declarative & workflow based infrastructure with Terraform
PDF
Terraform 0.9 + good practices
PDF
Terraform: Cloud Configuration Management (WTC/IPC'16)
PDF
Infrastructure as Code with Terraform
PPTX
Infrastructure as Code: Introduction to Terraform
PDF
Terraforming the Kubernetes Land
Building infrastructure with Terraform (Google)
Terraform Modules and Continuous Deployment
Declarative & workflow based infrastructure with Terraform
Terraform 0.9 + good practices
Terraform: Cloud Configuration Management (WTC/IPC'16)
Infrastructure as Code with Terraform
Infrastructure as Code: Introduction to Terraform
Terraforming the Kubernetes Land

What's hot (20)

PPTX
"Continuously delivering infrastructure using Terraform and Packer" training ...
PDF
Terraform in action
PDF
Infrastructure as Code in Google Cloud
PDF
Refactoring terraform
PDF
Everything as Code with Terraform
PPTX
Effective terraform
PDF
Everything as Code with Terraform
PDF
Hashiconf EU 2019 - A Tour of Terraform 0.12
PDF
Writing Ansible Modules (DENOG11)
PPTX
Terraform at Scale
PDF
Terraform Introduction
PDF
Terraform in deployment pipeline
PDF
Terraform modules and best-practices - September 2018
PDF
Using Terraform.io (Human Talks Montpellier, Epitech, 2014/09/09)
PDF
Terraform -- Infrastructure as Code
PDF
London Hug 19/5 - Terraform in Production
PDF
Infrastructure as code with Terraform
PDF
Ground Control to Nomad Job Dispatch
PPTX
Reusable, composable, battle-tested Terraform modules
PDF
Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...
"Continuously delivering infrastructure using Terraform and Packer" training ...
Terraform in action
Infrastructure as Code in Google Cloud
Refactoring terraform
Everything as Code with Terraform
Effective terraform
Everything as Code with Terraform
Hashiconf EU 2019 - A Tour of Terraform 0.12
Writing Ansible Modules (DENOG11)
Terraform at Scale
Terraform Introduction
Terraform in deployment pipeline
Terraform modules and best-practices - September 2018
Using Terraform.io (Human Talks Montpellier, Epitech, 2014/09/09)
Terraform -- Infrastructure as Code
London Hug 19/5 - Terraform in Production
Infrastructure as code with Terraform
Ground Control to Nomad Job Dispatch
Reusable, composable, battle-tested Terraform modules
Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...
Ad

Similar to Terraform: Configuration Management for Cloud Services (20)

PDF
Terraform – Infrastructure as Code (Kielux'18)
PDF
Infrastructure as Code with Terraform
PDF
Terraform AWS modules and some best practices - September 2019
PPTX
Infrastructure as code with terraform and packer
PDF
Terraform introduction
PDF
Best Practices of Infrastructure as Code with Terraform
PPTX
Dive into DevOps | March, Building with Terraform, Volodymyr Tsap
PDF
Terraform modules and (some of) best practices
PDF
OracleBeer_Terraform_soe.pdf
PDF
Hashicorp-Terraform-Deep-Dive-with-no-Fear-Victor-Turbinsky-Texuna.pdf
PDF
Terraform-2.pdf
PDF
A Hands-on Introduction on Terraform Best Concepts and Best Practices
PDF
Terraform AWS modules and some best-practices - May 2019
PDF
DevOps Braga #9: Introdução ao Terraform
PDF
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
PDF
Self-service PR-based Terraform
PDF
CDK Meetup: Rule the World through IaC
PDF
Oracle Cloud - Infrastruktura jako kód
PDF
Terraform 0.12 Deep Dive: HCL 2.0 for Infrastructure as Code, Remote Plan & A...
PDF
Workshop Infrastructure as Code - Suestra
Terraform – Infrastructure as Code (Kielux'18)
Infrastructure as Code with Terraform
Terraform AWS modules and some best practices - September 2019
Infrastructure as code with terraform and packer
Terraform introduction
Best Practices of Infrastructure as Code with Terraform
Dive into DevOps | March, Building with Terraform, Volodymyr Tsap
Terraform modules and (some of) best practices
OracleBeer_Terraform_soe.pdf
Hashicorp-Terraform-Deep-Dive-with-no-Fear-Victor-Turbinsky-Texuna.pdf
Terraform-2.pdf
A Hands-on Introduction on Terraform Best Concepts and Best Practices
Terraform AWS modules and some best-practices - May 2019
DevOps Braga #9: Introdução ao Terraform
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
Self-service PR-based Terraform
CDK Meetup: Rule the World through IaC
Oracle Cloud - Infrastruktura jako kód
Terraform 0.12 Deep Dive: HCL 2.0 for Infrastructure as Code, Remote Plan & A...
Workshop Infrastructure as Code - Suestra
Ad

More from Martin Schütte (9)

PDF
Writing Ansible Modules (CLT'19)
PDF
The IPv6 Snort Plugin (at DeepSec 2014)
PDF
The IPv6 Snort Plugin (at Troopers 14 IPv6 Security Summit)
PDF
Short Introduction to IPv6
PDF
Software Testing on the Web
PDF
NetBSD syslogd with IETF Syslog Protocols
PDF
PGP/GPG Einführung
PDF
Design and Implementation of an IPv6 Plugin for the Snort Intrusion Detection...
PDF
Syslog Protocols
Writing Ansible Modules (CLT'19)
The IPv6 Snort Plugin (at DeepSec 2014)
The IPv6 Snort Plugin (at Troopers 14 IPv6 Security Summit)
Short Introduction to IPv6
Software Testing on the Web
NetBSD syslogd with IETF Syslog Protocols
PGP/GPG Einführung
Design and Implementation of an IPv6 Plugin for the Snort Intrusion Detection...
Syslog Protocols

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
Teaching material agriculture food technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
A Presentation on Artificial Intelligence
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
cuic standard and advanced reporting.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Approach and Philosophy of On baking technology
MYSQL Presentation for SQL database connectivity
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Network Security Unit 5.pdf for BCA BBA.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
NewMind AI Monthly Chronicles - July 2025
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Diabetes mellitus diagnosis method based random forest with bat algorithm
Teaching material agriculture food technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
A Presentation on Artificial Intelligence
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
cuic standard and advanced reporting.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Approach and Philosophy of On baking technology

Terraform: Configuration Management for Cloud Services

  • 1. Terraform: Configuration Management for Cloud Services Martin Schütte 27 April 2016
  • 2. TERRAFORM Build,  Combine,  and  Launch  Infrastructure
  • 4. by Rodzilla at Wikimedia Commons (CC-BY-SA-3.0) From Servers … Martin Schütte | Terraform | OSDC’16 3/29
  • 5. …to Services Martin Schütte | Terraform | OSDC’16 4/29
  • 6. Services also need Configuration Management • Replace “click paths” with source code in VCS • Lifecycle awareness, not just a setup.sh • Reproducible environments • Specification, documentation, policy enforcement Martin Schütte | Terraform | OSDC’16 5/29
  • 7. Core Ideas in Terraform • Simple model of resource entities with attributes • Stateful lifecycle with CRUD operations • Declarative configuration • Dependencies by inference • Parallel execution Martin Schütte | Terraform | OSDC’16 6/29
  • 8. Core Concepts in Terraform • Provider: a source of resources (usually with an API endpoint & authentication) • Resource: every thing “that has a set of configurable attributes and a lifecycle (create, read, update, delete)” – implies ID and state • Provisioner: initialize a resource with local or remote scripts Martin Schütte | Terraform | OSDC’16 7/29
  • 9. Core Concepts in Terraform • Order: directed acyclic graph of all resources • Plan: generate an execution plan for review before applying a configuration • State: execution result is kept in state file (local or remote) • Lightweight: little provider knowledge, no error handling Martin Schütte | Terraform | OSDC’16 8/29
  • 10. Available services Providers: • AWS • Azure • Google Cloud • Heroku • DNSMadeEasy • OpenStack • Docker • … Resources: • aws_instance • aws_vpc • aws_elb • aws_iam_user • azure_instance • heroku_app • … Provisioners: • chef • file • local-exec • remote-exec Martin Schütte | Terraform | OSDC’16 9/29
  • 11. DSL Syntax • Hashicorp Configuration Language (HCL), think “JSON-like but human-friendly” • Variables • Interpolation, e. g. ”number ${count.index + 1}” • Attribute access with resource_type.resource_name • Few build-in functions, e. g. base64encode(string), format(format, args…) Martin Schütte | Terraform | OSDC’16 10/29
  • 12. HCL vs. JSON # An AMI variable ”ami” { description = ”custom AMI” } /* A multi line comment. */ resource ”aws_instance” ”web” { ami = ”${var.ami}” count = 2 source_dest_check = false connection { user = ”root” } } { ”variable”: { ”ami”: { ”description”: ”custom AMI” } }, ”resource”: { ”aws_instance”: { ”web”: { ”ami”: ”${var.ami}”, ”count”: 2, ”source_dest_check”: false, ”connection”: { ”user”: ”root” } } } } } Martin Schütte | Terraform | OSDC’16 11/29
  • 14. Example: Simple Webservice (part 1) ### AWS Setup provider ”aws” { access_key = ”${var.aws_access_key}” secret_key = ”${var.aws_secret_key}” region = ”${var.aws_region}” } # Queue resource ”aws_sqs_queue” ”importqueue” { name = ”${var.app_name}-${var.aws_region}-importqueue” } # Storage resource ”aws_s3_bucket” ”importdisk” { bucket = ”${var.app_name}-${var.aws_region}-importdisk” acl = ”private” } Martin Schütte | Terraform | OSDC’16 12/29
  • 15. Example: Simple Webservice (part 2) ### Heroku Setup provider ”heroku” { ... } # Importer resource ”heroku_app” ”importer” { name = ”${var.app_name}-${var.aws_region}-import” region = ”eu” config_vars { SQS_QUEUE_URL = ”${aws_sqs_queue.importqueue.id}” S3_BUCKET = ”${aws_s3_bucket.importdisk.id}” } } resource ”heroku_addon” ”mongolab” { app = ”${heroku_app.importer.name}” plan = ”mongolab:sandbox” } Martin Schütte | Terraform | OSDC’16 13/29
  • 16. terraform graph | dot -Tpdf aws_s3_bucket.importdisk provider.aws aws_sqs_queue.importqueue heroku_addon.mongolab heroku_app.importer provider.heroku Martin Schütte | Terraform | OSDC’16 14/29
  • 17. Terraform Process *.tf override.tfModules “source” terraform.tfvars plan state get plan apply destroy Martin Schütte | Terraform | OSDC’16 15/29
  • 18. Example: Add Provisioning # Importer resource ”heroku_app” ”importer” { name = ”${var.app_name}-${var.aws_region}-import” region = ”eu” config_vars { ... } provisioner ”local-exec” { command = <<EOT cd ~/projects/go-testserver && git remote add heroku ${heroku_app.importer.git_url} && git push heroku master EOT } } Martin Schütte | Terraform | OSDC’16 16/29
  • 19. Example: Add Outputs # Storage resource ”aws_s3_bucket” ”importdisk” { ... } # Importer resource ”heroku_app” ”importer” { ... } # Outputs output ”importer_bucket_arn” { value = ”${aws_s3_bucket.importdisk.arn}” } output ”importer_url” { value = ”${heroku_app.importer.web_url}” } output ”importer_gitrepo” { value = ”${heroku_app.importer.git_url}” } Martin Schütte | Terraform | OSDC’16 17/29
  • 21. Modules “Plain terraform code” lacks structure and reusability Modules • are subdirectories with self-contained terraform code • may be sourced from Git, Mercurial, HTTPS locations • use variables and outputs to pass data Martin Schütte | Terraform | OSDC’16 18/29
  • 22. Module Example Every Terraform directory may be used as a module. Here I use the previous webservice example. Martin Schütte | Terraform | OSDC’16 19/29
  • 23. Using a Module Example (part 1) module ”importer_west” { source = ”../simple” aws_region = ”eu-west-1” app_name = ”${var.app_name}” aws_access_key = ”${var.aws_access_key}” aws_secret_key = ”${var.aws_secret_key}” heroku_login_email = ”${var.heroku_login_email}” heroku_login_api_key = ”${var.heroku_login_api_key}” } module ”importer_central” { source = ”../simple” aws_region = ”eu-central-1” # ... } Martin Schütte | Terraform | OSDC’16 20/29
  • 24. Using a Module Example (part 2) # Main App, using modules resource ”heroku_app” ”main” { name = ”${var.app_name}-main” region = ”eu” config_vars { IMPORTER_URL_LIST = <<EOT [ ”${module.importer_west.importer_url}”, ”${module.importer_central.importer_url}” ] EOT } } output ”main_url” { value = ”${heroku_app.main.web_url}” } Martin Schütte | Terraform | OSDC’16 21/29
  • 26. How to Write Own Plugins • Learn you some Golang • Use the schema helper lib • Adapt to model of Provider (setup steps, authentication) and Resources (arguments/attributes and CRUD methods) Martin Schütte | Terraform | OSDC’16 22/29
  • 27. Plugin Example Simple Plugin: MySQL Implements provider mysql with resource mysql_database. Code at builtin/providers/mysql  Martin Schütte | Terraform | OSDC’16 23/29
  • 28. Usage
  • 29. Issues Under active development, current version 0.6.15 (April 22) • Still a few bugs, e. g. losing state info • Modules are very simple • Lacking syntactic sugar (e. g. aggregations, common repetitions) General problems for this kind of tool • Testing is inherently difficult • Provider coverage • Resource model mismatch, e. g. with Heroku apps • Ignorant of API rate limits, account ressource limits, etc. Martin Schütte | Terraform | OSDC’16 24/29
  • 30. Comparable Tools Tools: • AWS CloudFormation (with generator tools) • OpenStack Heat • Azure Resource Manager Templates Configuration Management: • SaltStack Salt Cloud • Ansible v2.0 includes cloud modules Libraries: • fog, Ruby cloud abstraction library • boto, Python AWS library Martin Schütte | Terraform | OSDC’16 25/29
  • 31. Workflow • Use a VCS, i. e. git • Use PGP to encrypt sensitive data, e. g. with Blackbox • Use separate user credentials, know how to revoke them • Take a look at Hashicorp Atlas and its workflow Martin Schütte | Terraform | OSDC’16 26/29
  • 32. Hashicorp Workflow image by Hashicorp Atlas: Artifact Pipeline and Image Deploys with Packer and Terraform Martin Schütte | Terraform | OSDC’16 27/29
  • 33. Links and Resources Defining system infrastructure as code and building it with tools doesn’t make the quality any better. At worst, it can complicate things. — Infrastructure as Code by Kief Morris • Terraform • hashicorp/terraform  • StackExchange/blackbox  • Terraforming – Export existing AWS resources • Terraform: Beyond the Basics with AWS • Terraform, VPC, and why you want a tfstate file per env Martin Schütte | Terraform | OSDC’16 28/29
  • 34. The End Thank You! Questions? Martin Schütte info@martin-schuette.de slideshare.net/mschuett/  Martin Schütte | Terraform | OSDC’16 29/29