Beruflich Dokumente
Kultur Dokumente
PIPELINE
by Anton Babenko
2
AGENDA
▸ Key concepts in Terraform
ANTON BABENKO
Terraform AWS fanatic
github.com/terraform-aws-modules
github.com/antonbabenko
@antonbabenko
linkedin.com/in/antonbabenko
anton@antonbabenko.com
4
www.terraform.io
5
TERRAFORM MODULES
Reuse code & «not invented here»
▸ github.com/terraform-aws-modules
WAY AHEAD…
TERRAFORM WORKSPACE
Just use terraform_remote_state instead… EOF
14
CI/CD TOOLS
▸ CircleCI/TravisCI
ATLANTIS
www.runatlantis.io
16
▸ Enterprise pricing
17
PRE-SUMMARY
Terraform code
CI/CD options
CI/CD GOTCHAS #1 18
GENERAL
▸ Remote state only
▸ Error handling:
▸ retry X times
▸ .terraform/*
▸ private repositories
CI/CD GOTCHAS #3 20
SECRETS
▸ Part of CI system, environment variables
▸ Infrastructure modules
▸ Composition
DESIGN PATTERNS 28
▸ Very flexible
▸ Versioning
DESIGN PATTERNS 29
▸ Versioning
DESIGN PATTERNS 30
TERRAFORM COMPOSITION
▸ Use specific version of infrastructure or resource modules
▸ Terragrunt is awesome
TYPES OF DELIVERY PIPELINES 31
BASIC PIPELINE
▸ git checkout -b new-feature
▸ git commit
▸ Open a pull-request
▸ …
RELATED TOOLS
▸ github.com/antonbabenko/pre-commit-terraform
▸ github.com/wata727/tflint
▸ github.com/segmentio/terraform-docs
▸ github.com/kamatama41/tfenv
▸ github.com/gruntwork-io/terragrunt
36
▸ Upgrades
▸ Rollbacks
▸ Force unlock
FREQUENT TERRAFORM PROBLEMS (FTP) 37
reddit.com/r/Terraform
FTP 38
REFACTORING
▸ terraform state mv
github.com/antonbabenko/terrible
FTP 39
TERRAFORM UPGRADE
▸ Enabled versioning on state bucket, right!?
TERRAFORM LOCKS
▸ terraform force-unlock
▸ Remember Atlantis
41
DEMO
https://github.com/antonbabenko/terraform-deployment-pipeline-talk
42
FINAL SUMMARY
▸ Use CI/CD for automated tasks (check, plan, apply, destroy, merge, promotion)
No workspaces and no
advanced arguments in CLI
QUESTIONS?