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

Understanding the Auth0 Provider for Terraform

Understanding the Auth0 Provider for Terraform

In this talk, Alex Kalyvitis (Software Engineer) joins James Quick (Developer Advocate at Auth0) and I to explain the basic concepts of the Auth0 Provider for HashiCorp Terraform.

This version of the presentation was given at two Auth0-hosted webinars in June and July 2020.

---

Companion Code: github.com/alexkappa/terraform-auth0-webinar

Kerim Satirli

June 30, 2020
Tweet

More Decks by Kerim Satirli

Other Decks in Technology

Transcript

  1. PRESENTED BY Alex Kalyvitis (He/Him) Software Engineer Kerim Satirli (He/Him)

    Developer Advocate at HashiCorp James Quick (He/Him) Developer Advocate at Auth0
  2. Agenda Introducing Terraform Infrastructure as Code Managing Auth0 with Terraform

    hands-on with Auth0 and Terraform Community Development working in open source
  3. Provider set-up CODE EDITOR provider "auth0" { version = "~>

    0.11" domain = var.auth0_domain client_id = var.auth0_client_id client_secret = var.auth0_client_secret }
  4. TERMINAL > terraform init Initializing the backend... Initializing provider plugins...

    - Checking for available provider plugins... - Downloading plugin for provider "auth0" (terraform-providers/auth0) 0.11.0... Terraform has been successfully initialized! You may now begin working with Terraform. Try running "terraform plan" to see any changes that are required for your infrastructure. All Terraform commands should now work. If you ever set or change modules or backend configuration for Terraform, rerun this command to reinitialize your working directory. If you forget, other commands will detect it and remind you to do so if necessary.
  5. Resource: Auth0 API CODE EDITOR resource "auth0_resource_server" "blog" { name

    = "Blog Post API" identifier = "https://api.blog.com" scopes { value = "write:posts" description = "Write posts" } }
  6. Resource: Auth0 Role CODE EDITOR resource "auth0_role" "writer" { name

    = "Writer" identifier = "Blog post writer" permissions { name = "write:post" resource_server_identifier = \ auth0_resource_server.blog.identifier } }
  7. Resource: Auth0 User CODE EDITOR resource "auth0_user" "jane_doe" { connection_name

    = "Username-Password-Authentication" email = "[email protected]" username = "jane" password = "I writez the blogz!" roles = [auth0_role.writer.id] }
  8. Command: terraform apply TERMINAL > terraform apply auth0_resource_server.blog: Creating... auth0_resource_server.blog:

    Creation complete after 0s auth0_role.writer: Creating... auth0_role.writer: Creation complete after 0s auth0_user.jane_doe: Creating... auth0_user.jane_doe: Creation complete after 1s Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
  9. Command: terraform import TERMINAL > terraform import auth0_resource_server.blog 5ef...36b auth0_resource_server.blog:

    Importing from ID 5ef...36 auth0_resource_server.blog: Import prepared! Prepared auth0_resource_server for import auth0_resource_server.blog: Refreshing state... [id=5ef...36b] Import successful!
  10. Materials ▪ blog: hashi.co/tf-auth0-blog ▪ interview: hashi.co/tf-auth0-interview ▪ community: hashi.co/tf-auth0-blog

    ▪ docs: hashi.co/tf-auth0-provider ▪ code: hashi.co/tf-auth0-code ▪ slides: hashi.co/tf-auth0 ▪ Terraform Cloud: hashi.co/tf-auth0-cloud