시작하기 전에
- 실습에서는 정해진 기간 동안 Google Cloud 프로젝트와 리소스를 만듭니다.
- 실습에는 시간 제한이 있으며 일시중지 기능이 없습니다. 실습을 종료하면 처음부터 다시 시작해야 합니다.
- 화면 왼쪽 상단에서 실습 시작을 클릭하여 시작합니다.
Solve Task One
/ 100
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
When you are connected, you are already authenticated, and the project is set to your PROJECT_ID. The output contains a line that declares the PROJECT_ID for this session:
gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
Click Authorize.
Your output should now look like this:
Output:
Output:
Example output:
gcloud, in Google Cloud, refer to the gcloud CLI overview guide.
This lab demonstrates how to use Terraform to create a Google Compute Engine (GCE) instance. You will define your infrastructure as code, allowing you to easily provision and manage your resources. This lab assumes you have basic knowledge of Google Cloud and Terraform.
Before you begin, ensure you have the following:
A Google Cloud project with billing enabled. You will need the Project ID for subsequent steps. The project ID will be:
Terraform installed on your local machine or in Cloud Shell. If using Cloud Shell, Terraform is pre-installed.
The Google Cloud SDK (gcloud) installed and configured. If using Cloud Shell, gcloud is pre-installed and authenticated.
Authenticate to your Google Cloud project. In Cloud Shell, this might be done automatically.
Set your Project ID to be:
Terraform uses a state file to track the resources it manages. For collaborative projects and increased reliability, it's best to store this state remotely in a Cloud Storage bucket.
Create a Cloud Storage bucket. The bucket name must be globally unique and should include your project ID as a prefix.
Enable versioning on the bucket. This allows you to revert to previous states if necessary.
Now, you will create the Terraform configuration files that define your GCE instance.
Create a file named main.tf with the following content:
Create a file named variables.tf (optional, but recommended for defining variables):
With the configuration files created, you can now initialize, plan, and apply your Terraform configuration.
Initialize Terraform. This downloads the necessary provider plugins.
Plan the changes. This shows you what Terraform will do before it makes any actual changes.
Apply the changes. This creates the GCE instance.
Once Terraform has finished, verify that the GCE instance has been created.
In the Google Cloud Console, navigate to Compute Engine > VM instances. You should see an instance named 'terraform-instance'.
Alternatively, use the gcloud command to list instances.
When you are finished, destroy the infrastructure to avoid incurring unnecessary costs.
Destroy the resources created by Terraform.
In this lab, you learned how to use Terraform to create a Google Compute Engine instance. By defining your infrastructure as code, you can easily manage and provision resources in a consistent and repeatable way. Remember to destroy your resources when you're finished to avoid unnecessary costs. Continue exploring Terraform's capabilities and integrate it into your Google Cloud workflows.
Manual Last Updated Jul 25, 2025
Lab Last Tested Jul 25, 2025
현재 이 콘텐츠를 이용할 수 없습니다
이용할 수 있게 되면 이메일로 알려드리겠습니다.
감사합니다
이용할 수 있게 되면 이메일로 알려드리겠습니다.
한 번에 실습 1개만 가능
모든 기존 실습을 종료하고 이 실습을 시작할지 확인하세요.