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

Intro to the Terraform Ecosystem

Intro to the Terraform Ecosystem

In this talk, Tony Carmichael (Product Lead, Terraform OSS Ecosystem at HashiCorp), Taylor Dolezal (Developer Advocate at HashiCorp) and I give an introduction to the Terraform ecosystem.

This version of the presentation was given at an internal meetup in October 2020.

---

Companion Code: github.com/ksatirli/code-quality-for-terraform

Kerim Satirli

October 26, 2020
Tweet

More Decks by Kerim Satirli

Other Decks in Technology

Transcript

  1. Agenda Infrastructure as Code Declarative, machine-readable definition files HashiCorp Terraform

    Safely and predictably make infrastructure changes HashiCorp Configuration Language Concise description of infrastructure Code Quality The good, bad, and the lint-able
  2. Terraform Providers 135+ Official / Verified Providers Cisco ACI, MSO,

    etc. 360+ Community Providers Auth0, 1Password, Unifi, etc.
  3. HashiCorp Configuration Language CODE EDITOR service "http" "web_proxy" { listen_addr

    = "127.0.0.1:8080" process "server" { command = ["proxy-app", "server"] } } variable "port" { description = "Port for web_proxy" default = 8080 }
  4. HashiCorp Configuration Language CODE EDITOR service "http" "web_proxy" { listen_addr

    = "127.0.0.1:${var.port}" process "server" { command = ["proxy-app", "server"] } } variable "port" { description = "Port for web_proxy" default = 8080 }
  5. TFLint .tflint.hcl rule "terraform_required_providers" { enabled = true } rule

    "terraform_required_version" { enabled = true } rule "terraform_naming_convention" { enabled = true format = "snake_case" }
  6. Command: tflint TERMINAL > tflint 1 issue(s) found: Warning: data

    "google_projects" "projects" is declared but not used (terraform_unused_declarations) on data-sources.tf line 11: 11: data "google_projects" "projects" {
  7. pre-commit .pre-commit-config.yaml --- fail_fast: true minimum_pre_commit_version: "2.6.0" repos: - repo:

    https://github.com/antonbabenko/pre-commit-terraform rev: v1.31.0 hooks: - id: terraform_fmt - id: terraform_validate
  8. GitHub Actions .github/workflows/terraform.yml --- name: "Code Quality: Terraform" on: push:

    pull_request: env: # `AWS_REGION` must be specified for `terraform validate` AWS_REGION: "xx-xxxx-0" ...
  9. GitHub Actions .github/workflows/terraform.yml ... - name: Run `terraform fmt` run:

    terraform fmt -diff -check -no-color -recursive - name: Run `terraform init` run: terraform init - name: Run `terraform validate` run: terraform validate -no-color