google-cloud-recipe-onboarding

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Onboarding to Google Cloud

Google Cloud 入门指南

This skill provides a streamlined "happy path" for a singleton developer to get started with Google Cloud. It covers everything from initial account setup to deploying your first cloud resource.
本技能为独立开发者提供了一条顺畅的Google Cloud入门“便捷路径”,内容涵盖从初始账户设置到部署首个云资源的所有步骤。

Overview

概述

For an individual developer, onboarding to Google Cloud involves establishing a personal identity, setting up a billing method, and creating a workspace (Project) where resources can be managed. Google Cloud offers a Free Tier and Free Trial for multiple products. Learn more here.
对于个人开发者而言,入门Google Cloud需要建立个人身份、设置支付方式,并创建一个可管理资源的工作区(Project)。Google Cloud为多款产品提供免费层级和免费试用服务。点击了解更多

Clarifying Questions

确认问题

Before proceeding, the agent should clarify the user's current status:
  1. Do you already have a Google Account (Gmail or Google Workspace)?
  2. Are you looking to set up a personal account for learning/experimentation, or are you part of an organization with existing infrastructure?
  3. Are you an IT admin within a larger enterprise, setting up Google Cloud for your organization?
  4. What is the first type of resource or application you are interested in building (e.g., a website, a data pipeline, a virtual machine)?
  5. Do you prefer to use the command line (CLI), an IDE (e.g. VSCode, Antigravity), or do you prefer using the web-based Google Cloud console?
开始操作前,Agent应先确认用户当前状态:
  1. 您是否已有Google Account(Gmail或Google Workspace)?
  2. 您是想要创建个人账户用于学习/实验,还是隶属于已有基础设施的组织?
  3. 您是否是大型企业的IT管理员,要为所在组织搭建Google Cloud?
  4. 您感兴趣构建的首个资源或应用类型是什么(例如网站、数据管道、虚拟机)?
  5. 您偏好使用命令行(CLI)、IDE(如VSCode、Antigravity),还是基于网页的Google Cloud console

Prerequisites

前置条件

  • A Google Account (e.g., @gmail.com).
  • A valid payment method (credit card or bank account) for billing verification (even for the free trial).
  • 一个Google Account(例如@gmail.com邮箱)。
  • 有效的支付方式(信用卡或银行账户)用于账单验证(即使是免费试用也需要)。

Steps

步骤

1. Sign Up and Activate Free Credit

1. 注册并激活免费额度

  1. Go to the Google Cloud Console.
  2. Sign in with your Google Account. This will "Activate" your $300 free credit.
  1. 访问Google Cloud Console
  2. 使用您的Google Account登录,这将激活300美元免费额度

2. Create Your First Google Cloud Project

2. 创建首个Google Cloud项目

Google Cloud resources are organized into Projects.
  1. In the Google Cloud console, click the project picker dropdown at the top of the page.
  2. Click New Project.
  3. Enter a Project Name (e.g.,
    my-first-gcp-project
    ).
  4. Note the generated Project ID; you will use this for CLI and API interactions.
  5. Click Create.
Google Cloud资源通过**Projects**进行组织。
  1. 在Google Cloud控制台中,点击页面顶部的项目选择器下拉菜单。
  2. 点击New Project
  3. 输入Project Name(例如
    my-first-gcp-project
    )。
  4. 记录生成的Project ID;您将在CLI和API交互中用到它。
  5. 点击Create

3. Set Up Billing

3. 设置账单

Ensure your project is linked to your Free Trial Cloud Billing account.
  1. Go to the Billing section in the console.
  2. Confirm that your new project is listed under "Projects linked to this billing account."
确保您的项目已关联到免费试用的Cloud Billing账户。
  1. 进入控制台的Billing板块。
  2. 确认您的新项目已列在“关联到此账单账户的项目”下。

4. Install and Initialize the Google Cloud CLI

4. 安装并初始化Google Cloud CLI

The Google Cloud CLI (
gcloud
CLI) is the primary tool for interacting with Google Cloud from your local machine.
  1. Download and install the Google Cloud CLI.
  2. Open your terminal and run:
    gcloud init
  3. Follow the prompts to log in and select your project.
Google Cloud CLI
gcloud
CLI)是从本地机器与Google Cloud交互的主要工具。
  1. 下载并安装Google Cloud CLI
  2. 打开终端并运行:
    gcloud init
  3. 按照提示登录并选择您的项目。

5. Enable Necessary APIs

5. 启用必要的API

Most services require their specific API to be enabled before use. For example, to use Cloud Run, run:
gcloud services enable run.googleapis.com
大多数服务需要先启用对应的API才能使用。例如,要使用Cloud Run,请运行:
gcloud services enable run.googleapis.com

6. Deploy Your First Resource

6. 部署首个资源

Choose a simple entry point based on your needs: - Cloud Run (Recommended for Apps): Deploy a containerized "Hello World" app. - Compute Engine: Create a small Linux VM (e.g.,
e2-micro
which is part of the Always Free tier in certain regions). - Cloud Storage: Create a bucket to store files.
Example (Cloud Run):
bash
    gcloud run deploy hello-world \
    --image=gcr.io/cloudrun/hello \ --platform=managed \ --region=us-central1 \
    --allow-unauthenticated
This command will output a public URL, that you can reach in a web browser. Congrats - you just deployed your first Google Cloud resource!
根据您的需求选择一个简单的入门方式:- **Cloud Run(应用推荐):**部署一个容器化的“Hello World”应用。- **Compute Engine:**创建一个小型Linux虚拟机(例如
e2-micro
,在部分地区属于永久免费层级)。- **Cloud Storage:**创建一个存储桶用于存储文件。
示例(Cloud Run):
bash
    gcloud run deploy hello-world \
    --image=gcr.io/cloudrun/hello \ --platform=managed \ --region=us-central1 \
    --allow-unauthenticated
该命令会输出一个公共URL,您可以在浏览器中访问它。恭喜您——您刚刚部署了首个Google Cloud资源!

7. Next Steps

7. 后续步骤

Validation Logic

验证逻辑

Use this logic to determine if the user has successfully completed the Google Cloud onboarding process:
  • Project Created: Does the user have a Project ID?
  • Billing Linked: Is the project associated with a billing account (check via
    gcloud beta billing projects describe PROJECT_ID
    )?
  • CLI Authenticated: Does
    gcloud config list
    show the correct account and project?
  • Resource Verified: Can the user access the URL or IP of the deployed resource?
使用以下逻辑判断用户是否已完成Google Cloud入门流程:
  • **项目已创建:**用户是否拥有Project ID?
  • **账单已关联:**项目是否已关联到账单账户(可通过
    gcloud beta billing projects describe PROJECT_ID
    检查)?
  • CLI已认证:
    gcloud config list
    是否显示正确的账户和项目?
  • **资源已验证:**用户能否访问已部署资源的URL或IP?