- Published on
Configuring Google Cloud for learn Terraform
- Authors
- Name
- Surya Harahap
- @suryaharahap18
Google Cloud Platform (GCP) offers a variety of advanced cloud services and can be used in conjunction with Terraform to manage infrastructure. However, before we can use Terraform with GCP, we need to log in to your Google Cloud account and set up the project to use. Here are simple steps to do this.
1. Log In to Google Cloud
First, you need to log in to your Google Cloud account. Open a terminal in VSCode or your favorite terminal, and run the following command. This command will open a browser for the authentication process. Sign in with the Google account you want to use.
gcloud auth login
2. View Available Projects
After logging in, you might have several projects in your Google Cloud account. To see the list of available projects, use the following command here.
gcloud projects list
3. Set Default Project
Once you know the PROJECT_ID of the project you want to use, set that project as the default with the following command.
gcloud config set project [PROJECT_ID]
Replace [PROJECT_ID] with the ID of the project you want to use. For example, if your project ID is my-project-development, the command will be:
gcloud config set project my-project-development
4. Verify the Active Project
To make sure which project is currently set as the default, you can use two commands:
Display all project config. This will show all active project configurations.
gcloud config list project
Display only the active project value.
gcloud config get-value project