Recall & Review
beginner
What is the purpose of the Terraform GCP provider?
The Terraform GCP provider allows Terraform to manage and interact with Google Cloud Platform resources by translating Terraform configurations into API calls to GCP.
Click to reveal answer
beginner
How do you specify the GCP project and region in the Terraform provider configuration?
You specify the project and region inside the provider block using the 'project' and 'region' attributes, for example:<br>
provider "google" {
project = "my-gcp-project"
region = "us-central1"
}Click to reveal answer
intermediate
What authentication methods can Terraform use to connect to GCP?
Terraform can authenticate to GCP using:<br>- Application Default Credentials (ADC)<br>- Service Account JSON key file<br>- Environment variables pointing to credentials<br>This allows Terraform to securely access GCP resources.
Click to reveal answer
beginner
What is the minimum Terraform block needed to initialize the GCP provider?
A minimal provider block looks like:<br>
provider "google" {
project = "your-project-id"
region = "your-region"
}<br>This tells Terraform which GCP project and region to use.Click to reveal answer
beginner
Why is it important to run 'terraform init' after adding the GCP provider?
'terraform init' downloads the GCP provider plugin and sets up the working directory so Terraform can communicate with GCP. Without it, Terraform cannot apply or plan changes.
Click to reveal answer
Which block in Terraform config specifies the GCP provider?
✗ Incorrect
The provider block with name "google" configures the GCP provider.
How does Terraform authenticate to GCP using a service account?
✗ Incorrect
Terraform uses the 'credentials' attribute to point to the service account JSON key file for authentication.
What command must you run to download the GCP provider plugin after adding it to your config?
✗ Incorrect
'terraform init' downloads provider plugins and initializes the working directory.
Which attribute is NOT part of the GCP provider configuration?
✗ Incorrect
'instance_type' is a resource attribute, not a provider configuration attribute.
What environment variable can Terraform use to find GCP credentials automatically?
✗ Incorrect
The 'GOOGLE_APPLICATION_CREDENTIALS' environment variable points to the JSON key file for authentication.
Explain how to set up the Terraform GCP provider from scratch.
Think about what Terraform needs to connect and manage GCP resources.
You got /3 concepts.
Describe the role of the 'terraform init' command in the GCP provider setup.
Consider what happens before you can plan or apply changes.
You got /3 concepts.