use terraform to scale your team - goto conference · use terraform to scale your team edward wilde...

25
Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Upload: others

Post on 22-May-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Use Terraform to scale your team

Edward Wilde - @openfaas core contributor - @ewildePlatform Architect, Form3

Page 2: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

What is the problem?

Page 3: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

https://xkcd.com/1205/

Page 4: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

What are we going to cover today?● Introduction to terraform

● Building our own provider

● Managing GitHub with Terraform

● Continuous deployment

Tweet @openfaas 🤳 📸 @ewilde

🔥 Live demos 🔥

Page 5: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

What is terraform?

Page 6: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Plan phase

Page 7: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Okay?Helps to evolve you infrastructure, safely and predictably

Page 8: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Apply phase

Page 9: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Let’s see it in action!

Page 10: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Review● Plan

● Apply

● State file

Page 11: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Providers

Page 12: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

> 100 official providers

Page 13: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

~10% contributed by Form3

Page 14: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Provider architecture

Page 15: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Simple plugin types help you create new providers

Page 16: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Manages infrastructure resources

Page 17: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Provider development workflow

Page 18: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

OpenFaaS providerdemo

Page 19: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Review● Provider config

● Resources

● Testing

Page 20: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Useful core Terraform golang packagesAcctest Random strings, certificates

Encryption GPG helpers

Logging Level, correct log output

Schema Provider and resource related structures

Validation Pre-canned functions to help you validate schema attributes

Page 21: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Deployment workflow

Page 22: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Continuous deployment

● Atlantis

● Terraform Enterprise+

Page 23: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Let’s see it in action

Page 24: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Wrapping up● Terraform

○ Manage complex infrastructure

○ Get access to popular providers

○ Extend your own with ease

● Automate your processes

○ Security / compliance

○ Growing your team

Get started today!

Page 25: Use Terraform to scale your team - GOTO Conference · Use Terraform to scale your team Edward Wilde - @openfaas core contributor - @ewilde Platform Architect, Form3

Other useful tools● Writing custom providers https://www.terraform.io/docs/extend/writing-custom-providers.html

● Terraform golang packages https://github.com/hashicorp/terraform/tree/master/helper

● OpenFaaS Provider https://github.com/ewilde/terraform-provider-openfaas

● Atlantis https://www.runatlantis.io/

● Terraform enterprise https://www.hashicorp.com/products/terraform/enterprise

● Terraform-docs https://github.com/segmentio/terraform-docs/

● Blast radius https://github.com/28mm/blast-radius

● Tfenv https://github.com/tfutils/tfenv

● Example code from talk https://github.com/12factor-io/goto-terraform