Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Workshop de Terraform

Workshop de Terraform

Pequeña charla sobre Terraform que di en nerdearla 2016, contando mi experiencia usando terraform en mi trabajo (invisionapp.com) Buenos Aires, Argentina

Pablo Fredrikson

June 23, 2017
Tweet

More Decks by Pablo Fredrikson

Other Decks in Technology

Transcript

  1. Recapitulemos Código para los servicios Código para aprovisionar servidores (chef,

    puppet) Código para generar los trabajos para Jenkins (Job DSL) Servidores (+DNS, +ELBs, etc) a mano
  2. ¿Qué necesitamos? Poder tener una lista de nuestra infraestructura completa

    (conteniendo servers y recursos externos como DNS, CDN, S3, SQS, etc) Manejar infraestructura de forma simple y rápida Manejar el ciclo de vida de los recursos Portabilidad entre proveedores (Google, Digital Ocean, AWS, DNSimple, CloudFare) Que sea seguro OpenSource
  3. resource "digitalocean_droplet" "web" { name = "tf-web" size = "512mb"

    image = "centos-5-8-x32" region = "sfo1" } resource "dnsimple_record" "hello" { domain = "example.com" name = "test" value = "${digitalocean_droplet.web.ipv4_address}" type = "A" } Terraform
  4. + digitalocean_droplet.web backups: "" => "<computed>" image: "" => "centos-5-8-x32"

    ipv4_address: "" => "<computed>" ipv4_address_private: "" => "<computed>" name: "" => "tf-web" private_networking "" => "<computed>" region: "" => "sfo1" size: "" => "512mb" status "" => "<computed>" + dnsimple_record.hello domain: "" => "example.com" domain_id: "" => "<computed>" hostname: "" => "<computed>" name: "" => "test" priority: "" => "<computed>" ttl: "" => "<computed>" type: "" => "A" value: "" => "${digitalocean_droplet.web.ipv4_address}"
  5. Terraform Siempre usar plan $ terraform apply ... Apply complete!

    Resources: 0 added, 0 changed, 180 destroyed. TERRORFORM
  6. terraform modules module "consul" { source = "github.com/hashicorp/consul/terraform/aws" servers =

    5 version = "0.4.0" } resource "dnsimple_record" "consul" { domain = "example.com" name = "consul" value = "${module.consul.ip_address}" type = "A" }