Slide 1

Slide 1 text

IaC with Terraform

Slide 2

Slide 2 text

2 … @me Marcos Nils Lilljedahl (@marcosnils) Head of Infra @ iúnigo, OS Developer, consultant & trainer - Ing. en sistemas / MoIT - OSS & Golang - Docker Captain - Container junkie - Active projects: Jedis, Vault, Goblin, dynamodb-filters, play-with-docker (and probably more) - crossfit, asado, mate, sailing, drinks & food.

Slide 3

Slide 3 text

3 La mejor aseguradora de la Argentina https://www.meetup.com/es-ES/10x-Buenos-Aires/

Slide 4

Slide 4 text

4

Slide 5

Slide 5 text

5 … Cloud vs on-prem

Slide 6

Slide 6 text

6 … Entering cloud

Slide 7

Slide 7 text

7 … Cloud automation 101

Slide 8

Slide 8 text

8 … Cloud automation 101 80% Outages caused by changes

Slide 9

Slide 9 text

9 … Dev practices

Slide 10

Slide 10 text

10 … Tools

Slide 11

Slide 11 text

11 … Tools

Slide 12

Slide 12 text

12 … Providers

Slide 13

Slide 13 text

13 … Hello world module

Slide 14

Slide 14 text

14 … Variables

Slide 15

Slide 15 text

15 … Handling Failure

Slide 16

Slide 16 text

16 … Failure Break resources into logical entities

Slide 17

Slide 17 text

17 … Importing

Slide 18

Slide 18 text

18 … Modules - DRY

Slide 19

Slide 19 text

19 … Modules

Slide 20

Slide 20 text

20 … Caveats - Weird errors - Provider issues - No step through execution - Rapid Change - State Corruption

Slide 21

Slide 21 text

21 … Lifecycle https://www.terraform.io/docs/enterprise/guides/recommended-practices/index.html 1. Local 2. Multi Environment 3. Workflow 4. Collaboration across teams 5. Organization

Slide 22

Slide 22 text

22 … General BP ● Review plan before apply ● Save plan to file and apply from it ● Terraform fmt ● Enable bucket versioning (s3) ● Using --target ● Keep too many resources in one dir ● Keep secrets unencrypted ● Build unnecesary modules

Slide 23

Slide 23 text

23 … Remote state datasource

Slide 24

Slide 24 text

24 … null_resource for validations

Slide 25

Slide 25 text

25 … for expressions

Slide 26

Slide 26 text

26 … generalized splat

Slide 27

Slide 27 text

27 … Useful ● https://www.terraform.io/docs/index.html ● https://learn.hashicorp.com/terraform/ ● https://github.com/runatlantis/atlantis ● https://registry.terraform.io/

Slide 28

Slide 28 text

28 Gracias!