O'Reilly logo

Implementing Modern DevOps by David Gonzalez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating resources

Now that we have all the requirements installed, we are going to create our first resource in order to help us to understand how Terraform works and how powerful it is. Create a folder called implementing-modern-devops somewhere in your computer and add a file called resources.tf with the following content:

provider "google" { credentials = "${file("xxx.json")}" project = "implementing-modern-devops" region = "europe-west1-b"}resource "google_compute_instance" "my-first-instance" {}

As you can see, the preceding snipped is very similar to JSON but it is actually called HCL: HashiCorp Configuration Language. Let's explain what the code is doing.

The first section is where we configure our credentials. As you can see, Terraform ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required