SlideShare a Scribd company logo
1 of 22
Download to read offline
Terraform: a tool for cloud
resource orchestration
Gabriel Mateescu
Outline
• Configuration management vs. Server templating vs. Server provisioning
• Overview of Terraform
• Examples of using Terraform
• Server provisioning and configuration
• Kubernetes cluster provisioning
• Demo: create a Kubernetes cluster
• Conclusion
3
Ad hoc scripts
4
Configuration management tools
Configuration management tools (2)
• Declarative: specify desired state
• Idempotent
6
Server templating
• Immutable infrastructure
7
Server template showing image configuration
8
Resource orchestration and provisioning
• Provides resource provisioning and
configuration, as well as ...
• Immutable infrastructure
• Terraform is an example of resource
orchestrator and provisioner
9
Overview of Terraform
• Terraform supports resource provisioning and
configuration in multiple cloud providers
• Azure
• AWS
• Google Cloud Plaform
• Terraform provides a single language, the
Terraform laguage, to interact in an uniform way
with multiple cloud APIs
10
Teraform is a single client interacting with cloud APIs
11
Terraform Language
• The Terraform language is a JSON-like Domain Specific
Language (DSL), using the HCL syntax, to specify
resources and their attributes
• The resources supported are representations of the
services offfered by the cloud provider
• Examples of resources
• Virtual Machines
• Disks
• Networks
• Container clusters
12
Example #1: server provisioning & configuration
• Provision and configure a virtual machine (VM) instance
in the AWS cloud
• The resource type in AWS for a virtual machine is
aws_instance
• The user_data attribute of the VM instance can be used
to configure the instance
13
• Terraform provisions a server off a VM image, and allows
to configure server-specific software using cloud provider-
specific mechanisms such as user_data for AWS
Example #1 continued 1
14
• Terraform supports variables, both statically and dynamically defined,
e.g., the public_ip attribute of the example instance of the
aws_instance resouce type, i.e., ${aws_instance.example.public_ip}
Example #1 continued 2
15
Example #2: Kubernetes cluster provisioning
• Provision and configure a Kubernetes cluster in the
Google Cloud Platform (GCP)
• The resource type in GCP for a kubernetes cluster is
google_container_cluster
• The resource type has as prefix the cloud provider
name, in this case google
• Cluster attributes can be required or optional:
• zone – required
• initial_node_count - optional
16
Example #2: continued 1
• For modularity, the code can be divided in multiple files
• Main configuration: main.tf
• Provider configurations: provider.tf
• Variable definition: variables.tf
17
Example #2: continued 2
• Define the cloud provider
• The credentials are obtained by creating a service account,
e.g. in the Google Cloud UI
18
Example #2: continued 3: define the cluster attributes
19
Example #2: continued 4: define the variables
20
Example #2: continued 5: create the cluster
21
Demo: Create a Kubernetes cluster with Terraform
Conclusion
• Resources offered by different cloud providers are different
• Databases, caches, load balancers
• Since resources are cloud-provider specific, Terraform code is cloud-
provider specific
• Terraform provides a language and toolset for creating resources in
multiple clouds

More Related Content

Similar to An introduction to the Terraform IaC tool

Similar to An introduction to the Terraform IaC tool (20)

Kubernetes Internals
Kubernetes InternalsKubernetes Internals
Kubernetes Internals
 
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlueCloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
 
What is OpenStack Trove? Trove Day 2014
What is OpenStack Trove? Trove Day 2014What is OpenStack Trove? Trove Day 2014
What is OpenStack Trove? Trove Day 2014
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Kubernetes Intro @HaufeDev
Kubernetes Intro @HaufeDev Kubernetes Intro @HaufeDev
Kubernetes Intro @HaufeDev
 
DevOps in AWS with Kubernetes
DevOps in AWS with KubernetesDevOps in AWS with Kubernetes
DevOps in AWS with Kubernetes
 
Kube journey 2017-04-19
Kube journey   2017-04-19Kube journey   2017-04-19
Kube journey 2017-04-19
 
Kubernetes intro
Kubernetes introKubernetes intro
Kubernetes intro
 
TDC2017 | São Paulo - Trilha Cloud Computing How we figured out we had a SRE ...
TDC2017 | São Paulo - Trilha Cloud Computing How we figured out we had a SRE ...TDC2017 | São Paulo - Trilha Cloud Computing How we figured out we had a SRE ...
TDC2017 | São Paulo - Trilha Cloud Computing How we figured out we had a SRE ...
 
Containerized architectures for deep learning
Containerized architectures for deep learningContainerized architectures for deep learning
Containerized architectures for deep learning
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
DevOps Braga #9: Introdução ao Terraform
DevOps Braga #9:  Introdução ao TerraformDevOps Braga #9:  Introdução ao Terraform
DevOps Braga #9: Introdução ao Terraform
 
Managing Container-as-a-Service and Docker Clusters in the Cloud with RightScale
Managing Container-as-a-Service and Docker Clusters in the Cloud with RightScaleManaging Container-as-a-Service and Docker Clusters in the Cloud with RightScale
Managing Container-as-a-Service and Docker Clusters in the Cloud with RightScale
 
Resilient microservices with Kubernetes - Mete Atamel
Resilient microservices with Kubernetes - Mete AtamelResilient microservices with Kubernetes - Mete Atamel
Resilient microservices with Kubernetes - Mete Atamel
 
Container Orchestration using Kubernetes
Container Orchestration using KubernetesContainer Orchestration using Kubernetes
Container Orchestration using Kubernetes
 
Introduction to Container Storage Interface (CSI)
Introduction to Container Storage Interface (CSI)Introduction to Container Storage Interface (CSI)
Introduction to Container Storage Interface (CSI)
 
Azure: Docker Container orchestration, PaaS ( Service Farbic ) and High avail...
Azure: Docker Container orchestration, PaaS ( Service Farbic ) and High avail...Azure: Docker Container orchestration, PaaS ( Service Farbic ) and High avail...
Azure: Docker Container orchestration, PaaS ( Service Farbic ) and High avail...
 
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 RaleighKube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
 
Intro to kubernetes
Intro to kubernetesIntro to kubernetes
Intro to kubernetes
 

Recently uploaded

Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
Wonjun Hwang
 

Recently uploaded (20)

Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهله
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
How to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in PakistanHow to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in Pakistan
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 

An introduction to the Terraform IaC tool

  • 1. Terraform: a tool for cloud resource orchestration Gabriel Mateescu
  • 2. Outline • Configuration management vs. Server templating vs. Server provisioning • Overview of Terraform • Examples of using Terraform • Server provisioning and configuration • Kubernetes cluster provisioning • Demo: create a Kubernetes cluster • Conclusion
  • 5. Configuration management tools (2) • Declarative: specify desired state • Idempotent
  • 7. 7 Server template showing image configuration
  • 8. 8 Resource orchestration and provisioning • Provides resource provisioning and configuration, as well as ... • Immutable infrastructure • Terraform is an example of resource orchestrator and provisioner
  • 9. 9 Overview of Terraform • Terraform supports resource provisioning and configuration in multiple cloud providers • Azure • AWS • Google Cloud Plaform • Terraform provides a single language, the Terraform laguage, to interact in an uniform way with multiple cloud APIs
  • 10. 10 Teraform is a single client interacting with cloud APIs
  • 11. 11 Terraform Language • The Terraform language is a JSON-like Domain Specific Language (DSL), using the HCL syntax, to specify resources and their attributes • The resources supported are representations of the services offfered by the cloud provider • Examples of resources • Virtual Machines • Disks • Networks • Container clusters
  • 12. 12 Example #1: server provisioning & configuration • Provision and configure a virtual machine (VM) instance in the AWS cloud • The resource type in AWS for a virtual machine is aws_instance • The user_data attribute of the VM instance can be used to configure the instance
  • 13. 13 • Terraform provisions a server off a VM image, and allows to configure server-specific software using cloud provider- specific mechanisms such as user_data for AWS Example #1 continued 1
  • 14. 14 • Terraform supports variables, both statically and dynamically defined, e.g., the public_ip attribute of the example instance of the aws_instance resouce type, i.e., ${aws_instance.example.public_ip} Example #1 continued 2
  • 15. 15 Example #2: Kubernetes cluster provisioning • Provision and configure a Kubernetes cluster in the Google Cloud Platform (GCP) • The resource type in GCP for a kubernetes cluster is google_container_cluster • The resource type has as prefix the cloud provider name, in this case google • Cluster attributes can be required or optional: • zone – required • initial_node_count - optional
  • 16. 16 Example #2: continued 1 • For modularity, the code can be divided in multiple files • Main configuration: main.tf • Provider configurations: provider.tf • Variable definition: variables.tf
  • 17. 17 Example #2: continued 2 • Define the cloud provider • The credentials are obtained by creating a service account, e.g. in the Google Cloud UI
  • 18. 18 Example #2: continued 3: define the cluster attributes
  • 19. 19 Example #2: continued 4: define the variables
  • 20. 20 Example #2: continued 5: create the cluster
  • 21. 21 Demo: Create a Kubernetes cluster with Terraform
  • 22. Conclusion • Resources offered by different cloud providers are different • Databases, caches, load balancers • Since resources are cloud-provider specific, Terraform code is cloud- provider specific • Terraform provides a language and toolset for creating resources in multiple clouds