an introduction to terraform

27
An introduction to Terraform Julien Pivotto (@roidelapluie) RMLL, Saint-Étienne July 4th, 2017

Upload: julien-pivotto

Post on 28-Jan-2018

324 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: An introduction to terraform

An introduction to Terraform

Julien Pivotto (@roidelapluie)

RMLL, Saint-Étienne

July 4th, 2017

Page 2: An introduction to terraform

whoamiJulien Pivotto

@roidelapluie

Sysadmin at inuits

Automation, monitoring, HA

RMLL 2013 org team

Page 3: An introduction to terraform

inuits

Page 4: An introduction to terraform

Building infrastructure

Cloud age

Baremtal: talking to your automation tool(cobbler, foreman)

PaaS: Talking to your infrastructure provider

Cloud: Talking to your cloud provider

Talk = Use the WebUI / API

Page 5: An introduction to terraform

Challenges of current infraPlanning changes

Executing changes

Working together

Keeping up to date (usable) inventories

Page 6: An introduction to terraform

DevOps

Page 7: An introduction to terraform

The DevOps principles: CAMS

(a definition of DevOps)

Culture

Automation

Measurement

Sharing

(Damon Edwards and John Willis, 2010 http://devopsdictionary.com/wiki/CAMS)

Page 8: An introduction to terraform

AutomationAutomate all the things

Version Control

Continuous Integration and Deployment

Infrastructure as Code

Page 9: An introduction to terraform

Terraform

Page 10: An introduction to terraform

TerraformOpen Source

Mozilla Public License 2.0

Created by Hashicorp (vagrant, consul, packer,vault)

Started in 2014

Written in Go

Pluggable

Page 11: An introduction to terraform

What is terraform?

Page 12: An introduction to terraform

Terraform original goalTerraform is a tool to Build, Change, and VersionControl your infrastructure.

Page 13: An introduction to terraform

Building infrastructureTalk to multiple cloud/infrasctucture providers

Ensure creation and consistency

Express in an API-Agnostic DSL

Page 14: An introduction to terraform

Change infrastructureApply incremental changes

Destroy when needed

Preview changes

Scale easily

Page 15: An introduction to terraform

Version controlHCL language

State file (don't store it in your git repo)

Page 16: An introduction to terraform

Terraform concepts

Page 17: An introduction to terraform

Variables

Terraform takes variables as input

Typed variables

JSON, HCL or CLI

Page 18: An introduction to terraform

OutputOutput specific text, ip addresses, ...

Console or JSON

Page 19: An introduction to terraform

Providers

Configuration of a resource provider

e.g.: cloud, dns provider, ...

Often require URL, API Key, ...

Page 20: An introduction to terraform

Modules

Group of resources

Takes parameters

Returns output

Page 21: An introduction to terraform

Plan

terraform plan

Creates a plan of changes required

Does nothing to the infra

Page 22: An introduction to terraform

Apply

terraform apply

Applies a plan, make all the changes

Can make the plan before if needed

Page 23: An introduction to terraform

Statefile

Current know state of the infra

Stored in file or externally

Locking

Page 24: An introduction to terraform

Destroy

terraform destroy

Delete all the resources

resources can be "protected" in config

Page 25: An introduction to terraform

Enough talking!

Demo!

Page 26: An introduction to terraform

More!https://terraform.io

terraform's cousins: packer, consul, vagrant,vault, ...

Page 27: An introduction to terraform

Julien Pivottoroidelapluie

[email protected]

Inuitshttps://[email protected]

Contact