ever changing technologies Flexibility • The infrastructure has to be flexible. • Changes are made more often as the product develops Maintainability ➔ Complex infrastructure can be hard to maintain ➔ Reliant on manual steps ➔ Time consuming
and integrate all the services in a predictable manner? How do we avoid the manual painful process? Update How do we maintain, add or remove services in our infrastructure with little interference and at the same time avoid the painful manual process? Replicate How can we recreate the infrastructure with the same services and performance with little interference ?
managing and provisioning computing infrastructure (processes, bare-metal servers, virtual servers, etc.) and their configuration through machine-processable definition files, rather than physical hardware configuration or the use of interactive configuration tools - wikipedia
plan into code, and test it Version Version your changes using version control systems (git) Provision Build your actual infrastructure Modify Add or remove services from your infrastructure
open source tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned. - Terraform enables you to safely and predictably create, change, and improve production infrastructure.
service providers API A provider is responsible for understanding API interactions and exposing resources. Example # Configure the Heroku provider provider "heroku" { email = "[email protected]" api_key = "${var.heroku_api_key}" } Find list of providers here
need to use across our scripts Define a variable variable "heroku_api_key" {} Usage provider "heroku" { email = "[email protected]" api_key = "${var.heroku_api_key}" }
that are managed as a group. Modules are used to create reusable components in Terraform as well as for basic code organization. Usage module "consul" { source = "github.com/hashicorp/consul/terraform/aws" servers = 3 } Find how to create modules here