From the course: Advanced Terraform

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Using Terraform modules

Using Terraform modules - Terraform Tutorial

From the course: Advanced Terraform

Using Terraform modules

- [Instructor] In this video, we're going to use the GCP service accounts module to demonstrate how to set up and use a module. Execute git checkout 02_09 to switch to the branch. Service accounts are non-user accounts used to authenticate system to system communications. They're used to secure resources like APIs, databases, file objects, and other resources accessed by internal system processes. We'll use the module to create one service account for each environment. First, let's take a look at the files here. main.tf was getting a bit long, so I split it up. We have main.tf. I put the networking data resource in the subnet in here. We have our storage buckets in storage.tf. And in serviceaccounts.tf, we have our service accounts module. So go ahead and open up the serviceaccounts.tf file. And let's execute terraform init. This will tell the Terraform CLI to download this module. The service accounts module does a…

Contents