0
0
Terraformcloud~5 mins

GCP provider setup in Terraform - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the GCP provider in Terraform?
The GCP provider allows Terraform to interact with Google Cloud Platform services by managing resources like compute instances, storage buckets, and networks.
Click to reveal answer
beginner
Which Terraform block is used to configure the GCP provider?
The provider "google" block is used to configure the GCP provider with credentials, project ID, and region.
Click to reveal answer
beginner
How do you specify the GCP project and region in Terraform provider configuration?
You specify them using the project and region arguments inside the provider "google" block.
Click to reveal answer
intermediate
What is the recommended way to provide credentials for the GCP provider in Terraform?
Use a service account key file and set the credentials argument to the file path, or set the GOOGLE_APPLICATION_CREDENTIALS environment variable.
Click to reveal answer
intermediate
Why is it important to pin the provider version in Terraform configuration?
Pinning the provider version ensures consistent behavior and avoids unexpected changes when new provider versions are released.
Click to reveal answer
Which block do you use to configure the GCP provider in Terraform?
Aprovider "google"
Bresource "google"
Cmodule "google"
Dvariable "google"
How do you specify the GCP project in Terraform provider configuration?
Aproject = "your-project-id" inside provider block
Bregion = "your-project-id" inside provider block
Cproject_id = "your-project-id" inside resource block
Dproject_name = "your-project-id" inside variable block
What is the best way to provide credentials to the GCP provider?
AUse anonymous access
BHardcode username and password in provider block
CUse a service account key file or environment variable
DNo credentials needed
Why should you pin the provider version in Terraform?
ATo make Terraform run faster
BTo reduce the size of Terraform files
CTo allow automatic upgrades
DTo avoid unexpected changes from new provider versions
Which environment variable can be used to provide GCP credentials to Terraform?
AGOOGLE_CLOUD_KEY
BGOOGLE_APPLICATION_CREDENTIALS
CTF_VAR_credentials
DGCP_CREDENTIALS_PATH
Explain how to set up the GCP provider in Terraform from scratch.
Think about what Terraform needs to connect and manage GCP resources.
You got /4 concepts.
    Describe why managing credentials securely is important when configuring the GCP provider.
    Consider risks of leaking credentials and how to prevent them.
    You got /4 concepts.