October 2017
Intermediate to advanced
326 pages
7h 20m
English
One thing we did not mention earlier is the fact that Terraform can work with variables. Take a look at the following definition:
provider "google" { credentials = "${file("xxx.json")}" project = "implementing-modern-devops" region = "europe-west1"}
This is the configuration of our provider. There are few strings that, quite likely, are going to be used in other places, such as the region or the name of the project. Terraform has the concept of variable, which is a value that is susceptible to change so we can extract it into a separated file. Up until now, we have created a file called resources.tf. Let's create a file called vars.tf with the following content:
variable "project_name" { type = "string" default = "implementing-modern-devops" ...