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

Terraform a shallow dive in

Alex Boten
December 06, 2018

Terraform a shallow dive in

The talk is an intro to Hashicorp's Terraform provisioning tool to aid in the move toward defining one’s infrastructure as code. We'll dive into resources, providers, provisioners and more concepts of Terraform.

Alex Boten

December 06, 2018
Tweet

More Decks by Alex Boten

Other Decks in Technology

Transcript

  1. What is Terraform? • Open source multi-service provisioning tool
 create

    complex environments across public cloud providers (e.g., AWS, Azure, Google Cloud, DigitalOcean) and private cloud and virtualization platforms (e.g. OpenStack, VMWare, Kubernetes) • Define your infrastructure as code
 configuration files can be in HCL or JSON • Provides Lifecycle Management
 create, read, update/versioning/drift re-alignment, and destroy
  2. The Basics: Providers • “Provide” cloud, multi-service support • Responsible

    for managing the lifecycle of their RESOURCES: CRUD • eg. azure, aws, gcp, cloudflare … • Required settings: Api key; URL, location
  3. The Basics: Resources • Provider specific Resources • Components of

    your infrastructure • Can customize lifecycle: create_before_destroy, prevent_destory, ignore_changes
  4. The Basics: Provisioners • Additional configuration per Provider/Resource • Two-types

    creation and destroy time • Multiple provisioners • Common one: remote-exec, file, chef… • desired state
  5. The Basics: Variables • Typed: string, list, map • Inputs

    and local • Set from CLI args, files: JSON, HCL • Set from environment variables TF_VAR_{name}
  6. The Basics: Outputs • Typed: string, list and map •

    Sensitivity • Console or JSON • Essential part of module
  7. The Basics: Modules • Group of resources • Needs inputs

    and should return outputs • Modules everywhere….
  8. The Basics: State • Generated file • Backend Storage: file

    is Local by default • Common Remotes: azure, s3, terraform enterprise
  9. Books Terraform: Up & Running by Yevgeniy Brikman https://www.terraformupandrunning.com/ Articles

    and Links Gruntwork: • https://blog.gruntwork.io • GitHub: Modules and tools (terragrunt, terratest)
 https://github.com/gruntwork-io CloudPosse: • Github: Modules https://github.com/cloudposse
  10. • Improve JSON support • 1st class expressions: “${var.name}” >>

    var.name • For expressions (loops) • Dynamic blocks • Conditional improvements • Biggest — Collaboration for Everyone. TFE Free tier Terraform 0.12
  11. Terraform 0.12 Deep Dive: Why HCL 2.0 and Remote Plan

    & Apply? Tuesday, December 11 2018 from 1:00 pm - 2:00 pm: Goto https://www.hashicorp.com/events to register for the webinar.