+ - 0:00:00
Notes for current slide

Presenter notes contain extra information which might be useful if you intend to use these slides for teaching.

Press P again to switch presenter notes off

Press C to create a new window where the same presentation will be displayed. This window is linked to the main window. Changing slides on one will cause the slide to change on the other.

Useful when presenting.

Notes for next slide



Terraform



last_modification Updated:   purlPURL: gxy.io/GTN:S00024

text-document Plain-text slides |

Tip: press P to view the presenter notes | arrow-keys Use arrow keys to move between slides
1 / 13

Presenter notes contain extra information which might be useful if you intend to use these slides for teaching.

Press P again to switch presenter notes off

Press C to create a new window where the same presentation will be displayed. This window is linked to the main window. Changing slides on one will cause the slide to change on the other.

Useful when presenting.

question Questions

  • What is Terraform?

  • In which situations is it good/bad?

  • How to use it for managing your VM cluster

2 / 13

objectives Objectives

  • Learn Terraform basics

  • Launch a VM with Terraform

  • Launch and tear down a cluster with Terraform

3 / 13

Why Terraform

  • Managing complex infrastructure is not easy

  • Needs to be reproducible

  • Needs to be failure resistant

4 / 13

Pets vs Cattle

  • A special, lovingly raised server
  • When they become ill you nurse them back to health
  • Everyone is sad when it dies
  • Generic and replacable
  • If one gets sick, you just kill it
  • If one dies, no one is sad

On the left is a very cute cat with big eyes, on the right is a picture of cows.

5 / 13

Terraform

"Infrastructure as Code"

  • Write code
  • Plan changes
  • Create reproducible infrastructure
6 / 13

Write: Infrastructure as Code

  • Your infrastructure is completely specified by easy-to-edit text files

  • Collaborate on infrastructure using git/hg/etc.

  • Automate everything using one piece of software (instead of OpenStack CLI + AWS CLI + ... )

resource "openstack_compute_instance_v2" "my-server" {
name = "my-server"
image_name = "CentOS 7"
flavor_name = "m1.large"
}
resource "aws_route53_record" "my.server" {
name = "my.server.example.org"
records = ["${openstack_compute_instance_v2.my-server.access_ip_v4}"]
}
7 / 13

Plan: your changes

  • See how changes will affect resources

  • Preview the planned changes before applying them

Text in the terminal showing that an openstack compute keypair my-cloud-key is being created. Plan: 2 to add, 0 to change, 0 to destroy

8 / 13

Easy to see which resources need to be recreated, can produce a nice graph of their dependencies.

Create: Reproducible Infrastructure

  • Combine resources across providers (VM from OpenStack, DNS from Amazon, everything done in correct order)

  • Consistently reproduce the same infrastructure in a new cloud, new project.

Graph of requirements showing relationship between provider, instance, and things like the keypair to be added

9 / 13

This was a fantastically useful feature for UseGalaxy.eu, we transitioned smoothly between two OpenStack clouds because we just could say terraform apply in our new cloud, our entire infrastructure was reproduced.

Manage Many Resources

ACME Alicloud Archive Arukas AWS Azure Azure Stack Bitbucket
Brightbox CenturyLinkCloud Chef Circonus Cloudflare CloudScale.ch
CloudStack Cobbler Consul Datadog DigitalOcean DNS DNSMadeEasy
DNSimple Docker Dyn External F5 BIG-IP Fastly FlexibleEngine GitHub
Gitlab Google Cloud Grafana Helm Heroku Hetzner Cloud HTTP
HuaweiCloud Icinga2 Ignition InfluxDB Kubernetes Librato Linode
Local Logentries LogicMonitor Mailgun MySQL Netlify New Relic
Nomad NS1 Null Nutanix 1&1 OpenStack OpenTelekomCloud
OpsGenie Oracle Cloud Infrastructure Oracle Cloud Platform Oracle Public
Cloud OVH Packet PagerDuty Palo Alto Networks PostgreSQL PowerDNS
ProfitBricks RabbitMQ Rancher Random RightScale Rundeck RunScope
Scaleway SoftLayer StatusCake Spotinst TelefonicaOpenCloud Template
TencentCloud Terraform Terraform Enterprise TLS Triton UltraDNS
Vault VMware vCloud Director VMware NSX-T VMware vSphere
10 / 13

Manage VMs across AWS, GCE, OpenStack, and other Clouds

Manage DNS entries with various providers

Manage Database users/tables/authorizations

Manage GitHub repository permissions

Advanced Features

If you find you love it, many advanced features:

  • modules for code re-use
  • Custom plugins
  • Provisioning VMs
  • GitHub integration
11 / 13

keypoints Key points

  • Terraform lets you develop and implement infrastructure-as-code within your organisation

  • It can drastically simplify management of large numbers of VMs

12 / 13

Thank You!

This material is the result of a collaborative work. Thanks to the Galaxy Training Network and all the contributors!

Author(s) orcid logoHelena Rasche avatar Helena Rasche
Reviewers Martin Čech avatarBjörn Grüning avatarSaskia Hiltemann avatarHelena Rasche avatarNicola Soranzo avatarCristóbal Gallardo avatar
page logo

Tutorial Content is licensed under Creative Commons Attribution 4.0 International License.

13 / 13

question Questions

  • What is Terraform?

  • In which situations is it good/bad?

  • How to use it for managing your VM cluster

2 / 13
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow