SlideShare una empresa de Scribd logo
1 de 36
Descargar para leer sin conexión
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Developing a (VCD)
Terraform Provider
Brett Mack Nicki Watt
@phpops @techiewatt
28/01/2016
1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2
Who are we?
• Hands on consultants

• Worked with a variety of clients using
various HashiCorp products

• HashiCorp partner





----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3
https://www.opencredo.com/2015/08/10/
boot-my-secure-government-cloud
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 4
Agenda
• Terraform Introduction

• The VCD Terraform provider 

approach and lessons learned

• Conclusion 

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The
Super Quick
5
Terraform
Introduction
^
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 6
Creates, manages, and manipulates
infrastructure resources.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 7
Multiple Infrastructure Providers -
IAAS, PAAS, SAAS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 8
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 9
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 10
Developing a (VCD)
Terraform provider
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 11
What is a
Terraform Provider Plugin?
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 12
Atlas DNSMadeEasy PowerDNS
AWS Docker Rundeck
Azure Dyn StatusCake
CloudFlare Google Cloud Template
CloudStack Heroku Terraform
Consul Mailgun TLS
Datadog OpenStack VMware vCloud Director
DigitalOcean Packet VMware vSphere
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 13
Atlas DNSMadeEasy PowerDNS
AWS Docker Rundeck
Azure Dyn StatusCake
CloudFlare Google Cloud Template
CloudStack Heroku Terraform
Consul Mailgun TLS
Datadog OpenStack VMware vCloud Director
DigitalOcean Packet VMware vSphere
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 14
Define what you want to control with
Terraform
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
vCloud Director
15
Edge Gateway
Internal Network
Destination NAT Source NATFirewall Rules
VApp VApp
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
vCloud Director
16
Edge Gateway
Internal Network
Destination NAT Source NATFirewall Rules
VApp VApp
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 17
Core Terraform Provider
Plugin Concepts
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 18
Provider
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 19
Provider
Resource
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 20
Resource
Schema
Provider
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Plugin
21
Resource
Schema
Provider
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 22
provider "vcd" {
…
}
resource “vcd_vapp” “web”
…
}
vms.tf
VCD Provider
Terraform launches provider binary
Preferred method of communication
Starts listening
Address given back to Terraform
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 23
How do these concepts
map to VCD?
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 24
vCloud Director
Edge Gateway
VDC Network
Destinati SourceFirewall
VApp VApp
Plugin
Details to
establish
connection
Individual
components
which can be
controlled
Contract
defining rules
when interacting
with resources
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 25
Schema
Provider
user
password
org
url
vdc
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 26
Schema
user
ValueType
Flags
Description
Default
Computed
Required
Optional
ForceNew
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 27
Schema
user
ValueType
Flags
Description
Default
Computed
Required
Optional
ValueType: TypeString
Description: vCD Username
Required: True
Computed
ForceNew
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 28
Resource
Provider Network
VApp
Firewall Rules
DNAT
SNAT
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 29
Resource
Create
Read
Update
Delete
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 30
Resource
Create
Read
Update
Delete
Exists
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 31
Defining the Provider in Go
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 32
func Provider() terraform.ResourceProvider {
return &schema.Provider{
Schema: map[string]*schema.Schema{
"user": &schema.Schema{
Type: schema.TypeString,
Required: true,
Description: “vCloud Director Username.",
},
"password": &schema.Schema{
Type: schema.TypeString,
Required: true,
Description: “vCloud Director Password.",
},
…
provider.go
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 33
func Provider() terraform.ResourceProvider {
return &schema.Provider{
Schema: …,
ResourcesMap: map[string]*schema.Resource{
"vcd_network": resourceVcdNetwork(),
"vcd_vapp": resourceVcdVApp(),
"vcd_firewall_rules": resourceVcdFirewallRules(),
"vcd_dnat": resourceVcdDNAT(),
"vcd_snat": resourceVcdSNAT(),
},
}
provider.go
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 34
Issues we encountered
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 35
Conclusion
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 36
Thanks 

Questions

Más contenido relacionado

La actualidad más candente

La actualidad más candente (17)

7 Deadly Sins of Sales
7 Deadly Sins of Sales7 Deadly Sins of Sales
7 Deadly Sins of Sales
 
مخرجات الدرس
مخرجات الدرسمخرجات الدرس
مخرجات الدرس
 
Formato de carta
Formato de cartaFormato de carta
Formato de carta
 
Formato para crear carta
Formato para crear carta Formato para crear carta
Formato para crear carta
 
Hitzak banatu II
Hitzak banatu IIHitzak banatu II
Hitzak banatu II
 
Hitzak banatu I
Hitzak banatu  IHitzak banatu  I
Hitzak banatu I
 
Sagardoaren prozesua
Sagardoaren prozesuaSagardoaren prozesua
Sagardoaren prozesua
 
Aashura urdu
Aashura urduAashura urdu
Aashura urdu
 
GEOMETRÍA ANIMAL
GEOMETRÍA ANIMALGEOMETRÍA ANIMAL
GEOMETRÍA ANIMAL
 
fun with english G1 U1
fun with english G1 U1fun with english G1 U1
fun with english G1 U1
 
Analisis novel
Analisis novelAnalisis novel
Analisis novel
 
El koala
El koalaEl koala
El koala
 
มติ+1+ปณ...[1]
มติ+1+ปณ...[1]มติ+1+ปณ...[1]
มติ+1+ปณ...[1]
 
تكنو 6
تكنو 6تكنو 6
تكنو 6
 
Exercices a saja
Exercices a sajaExercices a saja
Exercices a saja
 
Clase 8 al 12 septiembre
Clase 8 al 12 septiembreClase 8 al 12 septiembre
Clase 8 al 12 septiembre
 
VOCABULARIO
VOCABULARIOVOCABULARIO
VOCABULARIO
 

Destacado

Museo Hermitage Rusia
Museo Hermitage RusiaMuseo Hermitage Rusia
Museo Hermitage Rusia
Art 37
 
Aigüestortes i estany de sant maurici núria a
Aigüestortes i estany de sant maurici núria aAigüestortes i estany de sant maurici núria a
Aigüestortes i estany de sant maurici núria a
annarusinol30
 
Presentación sobre Blog
Presentación sobre BlogPresentación sobre Blog
Presentación sobre Blog
guest20abada4
 
Трансформация Организационной Культуры
Трансформация Организационной КультурыТрансформация Организационной Культуры
Трансформация Организационной Культуры
Adam Filler
 
Aivanhov, omraam mikhael a primi si a darui
Aivanhov, omraam mikhael   a primi si a daruiAivanhov, omraam mikhael   a primi si a darui
Aivanhov, omraam mikhael a primi si a darui
Pascu Otilia
 
Microsoft word applications (edcp 610)
Microsoft word applications (edcp 610)Microsoft word applications (edcp 610)
Microsoft word applications (edcp 610)
cstrelow
 

Destacado (20)

Graduate Profile
Graduate ProfileGraduate Profile
Graduate Profile
 
We've Got This Whole Unicorn Thing Wrong (pptx)
We've Got This Whole Unicorn Thing Wrong (pptx)We've Got This Whole Unicorn Thing Wrong (pptx)
We've Got This Whole Unicorn Thing Wrong (pptx)
 
Museo Hermitage Rusia
Museo Hermitage RusiaMuseo Hermitage Rusia
Museo Hermitage Rusia
 
Aigüestortes i estany de sant maurici núria a
Aigüestortes i estany de sant maurici núria aAigüestortes i estany de sant maurici núria a
Aigüestortes i estany de sant maurici núria a
 
Presentation for advanced strategic course
Presentation for advanced strategic coursePresentation for advanced strategic course
Presentation for advanced strategic course
 
From whole to the part
From whole to the partFrom whole to the part
From whole to the part
 
Top Campaigns for the 2015 Holidays
Top Campaigns for the 2015 HolidaysTop Campaigns for the 2015 Holidays
Top Campaigns for the 2015 Holidays
 
Toronto Society of Architects 2013 Yearbook
Toronto Society of Architects 2013 YearbookToronto Society of Architects 2013 Yearbook
Toronto Society of Architects 2013 Yearbook
 
Arash Arabi - A guide to multi-organisational distributed scrum
Arash Arabi - A guide to multi-organisational distributed scrumArash Arabi - A guide to multi-organisational distributed scrum
Arash Arabi - A guide to multi-organisational distributed scrum
 
Presentación sobre Blog
Presentación sobre BlogPresentación sobre Blog
Presentación sobre Blog
 
Трансформация Организационной Культуры
Трансформация Организационной КультурыТрансформация Организационной Культуры
Трансформация Организационной Культуры
 
Aivanhov, omraam mikhael a primi si a darui
Aivanhov, omraam mikhael   a primi si a daruiAivanhov, omraam mikhael   a primi si a darui
Aivanhov, omraam mikhael a primi si a darui
 
改變想法的藝術
改變想法的藝術改變想法的藝術
改變想法的藝術
 
The Power of One by Steve Molis
The Power of One by Steve MolisThe Power of One by Steve Molis
The Power of One by Steve Molis
 
Lista de-precios-compugreiff-agosto-31-2012
Lista de-precios-compugreiff-agosto-31-2012Lista de-precios-compugreiff-agosto-31-2012
Lista de-precios-compugreiff-agosto-31-2012
 
75 frases de Rumi
75 frases de Rumi75 frases de Rumi
75 frases de Rumi
 
Pencil Shavings: 4Q14 GPC, Beijing
Pencil Shavings: 4Q14 GPC, BeijingPencil Shavings: 4Q14 GPC, Beijing
Pencil Shavings: 4Q14 GPC, Beijing
 
Microsoft word applications (edcp 610)
Microsoft word applications (edcp 610)Microsoft word applications (edcp 610)
Microsoft word applications (edcp 610)
 
Sound design
Sound designSound design
Sound design
 
White Paper: Ganzheitliche Schulungskonzepte als Erfolgsfaktor einer Office E...
White Paper: Ganzheitliche Schulungskonzepte als Erfolgsfaktor einer Office E...White Paper: Ganzheitliche Schulungskonzepte als Erfolgsfaktor einer Office E...
White Paper: Ganzheitliche Schulungskonzepte als Erfolgsfaktor einer Office E...
 

London Hashicorp Meetup (8th Mar 2016)