Slide 1

Slide 1 text

Copyright © 2020 HashiCorp Understanding the Auth0 Provider for Terraform

Slide 2

Slide 2 text

PRESENTED BY Alex Kalyvitis (He/Him) Software Engineer Kerim Satirli (He/Him) Developer Advocate at HashiCorp James Quick (He/Him) Developer Advocate at Auth0

Slide 3

Slide 3 text

James Quick github.com/jamesqquick Developer Advocate at Auth0

Slide 4

Slide 4 text

Alex Kalyvitis github.com/alexkappa Software Engineer

Slide 5

Slide 5 text

Kerim Satirli github.com/ksatirli Developer Advocate at HashiCorp

Slide 6

Slide 6 text

Agenda Introducing Terraform Infrastructure as Code Managing Auth0 with Terraform hands-on with Auth0 and Terraform Community Development working in open source

Slide 7

Slide 7 text

Infrastructure as Code ▪ executable documentation ▪ enables collaboration ▪ safe and predictable

Slide 8

Slide 8 text

Introducing Terraform

Slide 9

Slide 9 text

Terraform 125+ Official Providers AWS, Azure, GCP, etc. 175+ Community Providers Auth0, Sentry, Unifi, etc.

Slide 10

Slide 10 text

Auth0 and Terraform

Slide 11

Slide 11 text

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 }

Slide 12

Slide 12 text

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.

Slide 13

Slide 13 text

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" } }

Slide 14

Slide 14 text

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 } }

Slide 15

Slide 15 text

Resource: Auth0 User CODE EDITOR resource "auth0_user" "jane_doe" { connection_name = "Username-Password-Authentication" email = "jane.doe@blog.com" username = "jane" password = "I writez the blogz!" roles = [auth0_role.writer.id] }

Slide 16

Slide 16 text

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.

Slide 17

Slide 17 text

Verify: Auth0 Dashboard manage.auth0.com/dashboard/eu/alexkappa/apis

Slide 18

Slide 18 text

Verify: Auth0 Dashboard manage.auth0.com/dashboard/eu/alexkappa/apis

Slide 19

Slide 19 text

Verify: Auth0 Dashboard manage.auth0.com/dashboard/eu/alexkappa/roles

Slide 20

Slide 20 text

Verify: Auth0 Dashboard manage.auth0.com/dashboard/eu/alexkappa/roles

Slide 21

Slide 21 text

Verify: Auth0 Dashboard manage.auth0.com/dashboard/eu/alexkappa/roles

Slide 22

Slide 22 text

Verify: Auth0 Dashboard manage.auth0.com/dashboard/eu/alexkappa/roles

Slide 23

Slide 23 text

Command: terraform import TERMINAL > terraform import ADDR id

Slide 24

Slide 24 text

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!

Slide 25

Slide 25 text

Community Development

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

Thank You kerim@hashicorp.com