瞭解如何使用 Terraform 在 Google Cloud上可靠地佈建基礎架構。
瞭解詳情
歡迎
免費試用,開始在 Google Cloud 上建構及部署服務。
使用價值 $300 美元的免費抵免額,開始進行概念驗證
-
取得 Gemini 2.0 Flash Thinking 的存取權
-
每月免費使用 AI API 和 BigQuery 等熱門產品
-
不會自動收費,也不會要求您一定要購買特定方案
繼續探索超過 20 項一律免費的產品
使用超過 20 項實用的免費產品,包括 AI API、VM 和 data warehouse 等。
訓練
訓練與教學課程
在本實驗室中,您將安裝 Terraform,並使用 Terraform 建立 VM 執行個體。
訓練
訓練與教學課程
在本實驗室中,您將使用 Terraform 撰寫基礎架構即程式碼。
訓練
訓練與教學課程
在本實驗室中,您將瞭解如何使用 Terraform 說明及啟動雲端資源。
訓練
訓練與教學課程
瞭解如何管理狀態
在本實驗室中,您將瞭解如何在 Google Cloud Storage 中儲存 Terraform 狀態。
訓練
訓練與教學課程
在本實驗室中,您將瞭解模組如何解決程式碼複雜度、重複和重複使用等問題。
訓練
訓練與教學課程
瞭解如何使用政策驗證
在本實驗室中,您將瞭解如何對 Terraform 設定強制執行政策。
程式碼範例
程式碼範例
資源範例
尋找可建構基礎架構的範例。
程式碼範例
程式碼範例
藍圖
尋找可部署及重複使用的 Terraform 模組。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-04 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eThis page provides comprehensive documentation on using Terraform to provision and manage infrastructure on Google Cloud, including tutorials, references, and best practices.\u003c/p\u003e\n"],["\u003cp\u003eYou can get started with Terraform by following tutorials on running a web server, storing state in Cloud Storage, and using basic commands.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation covers advanced topics such as managing infrastructure as code with GitOps, exporting and importing resources, and using policy validation for compliance.\u003c/p\u003e\n"],["\u003cp\u003eResources include self-paced training modules on various Terraform topics, as well as code samples and reusable Terraform modules available on GitHub.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation provides resources to obtain support for Terraform, through community resources and other support channels.\u003c/p\u003e\n"]]],[],null,["# Terraform on Google Cloud documentation\n=======================================\n\n[Read product documentation](/docs/terraform/terraform-overview)\nLearn how to use Terraform to reliably provision infrastructure on Google Cloud.\n[Learn more](/docs/terraform/terraform-overview)\n\n\u003cbr /\u003e\n\nStart building and deploying on Google Cloud with a [free trial](https://console.cloud.google.com/freetrial). \n\n\u003cbr /\u003e\n\n[Get started for free](https://console.cloud.google.com/freetrial) \n\n#### Start your proof of concept with $300 in free credit\n\n- Get access to Gemini 2.0 Flash Thinking\n- Free monthly usage of popular products, including AI APIs and BigQuery\n- No automatic charges, no commitment \n[View free product offers](/free/docs/free-cloud-features#free-tier) \n\n#### Keep exploring with 20+ always-free products\n\n\nAccess 20+ free products for common use cases, including AI APIs, VMs, data warehouses,\nand more.\n\nDocumentation resources\n-----------------------\n\nFind quickstarts and guides, review key references, and get help with common issues. \nfollow_the_signs\n\n### Get started\n\n- Tutorial \n\n\n [Get started with Terraform](/docs/terraform/get-started-with-terraform)\n\n- Reference \n\n\n [Basic Terraform commands](/docs/terraform/basic-commands)\n\n- Tutorial \n\n\n [Store Terraform state](/docs/terraform/resource-management/store-state)\n\n- Tutorial \n\n\n [HashiCorp tutorials](https://learn.hashicorp.com/collections/terraform/gcp-get-started)\n\n- Reference \n\n\n [Google Cloud provider](https://registry.terraform.io/providers/hashicorp/google/latest/docs)\n\nemoji_objects\n\n### Learn more\n\n- Best practice \n\n\n [Terraform best practices](/docs/terraform/best-practices-for-terraform)\n\n- Conceptual guide \n\n\n [Understanding APIs and Terraform](/docs/terraform/understanding-apis-and-terraform)\n\n- Tutorial \n\n\n [Manage infrastructure as code](/architecture/managing-infrastructure-as-code)\n\n- Reference \n\n\n [Get support for Terraform issues](/docs/terraform/getting-support)\n\nformat_list_numbered\n\n### Use tools\n\n- Tutorial \n\n\n [Export resources into Terraform](/docs/terraform/resource-management/export)\n\n- Tutorial \n\n\n [Import resources into Terraform state](/docs/terraform/resource-management/import)\n\n- Tutorial \n\n\n [Create a configuration with Service Catalog](/service-catalog/docs/terraform-configuration)\n\n- Technical \n\n\n [Use policy validation](/docs/terraform/policy-validation)\n\nRelated resources\n-----------------\n\nTraining and tutorials \nCode samples \nExplore self-paced training, use cases, reference architectures, and code samples with examples of how to use and connect Google Cloud services. Training \nTraining and tutorials\n\n### Learn Terraform fundamentals\n\n\nIn this lab, you install Terraform and create a VM instance using Terraform.\n\n\n[Learn more](https://www.cloudskillsboost.google/focuses/1208?parent=catalog) \nTraining \nTraining and tutorials\n\n### Learn how to automate Infrastructure on Google Cloud with Terraform\n\n\nIn this lab, you write infrastructure as code with Terraform.\n\n\n[Learn more](https://www.cloudskillsboost.google/focuses/15841?parent=catalog) \nTraining \nTraining and tutorials\n\n### Learn how to build Cloud Infrastructure with Terraform\n\n\nIn this lab, you learn how to describe and launch cloud resources with Terraform.\n\n\n[Learn more](https://www.cloudskillsboost.google/focuses/17763?parent=catalog) \nTraining \nTraining and tutorials\n\n### Learn about managing state\n\n\nIn this lab, you learn how to store Terraform state in Google Cloud Storage.\n\n\n[Learn more](https://www.cloudskillsboost.google/focuses/15845?parent=catalog) \nTraining \nTraining and tutorials\n\n### Learn to use Terraform modules\n\n\nIn this lab, you learn how modules can address problems of code complexity, duplication, and reuse.\n\n\n[Learn more](https://www.cloudskillsboost.google/focuses/15836?parent=catalog) \nTraining \nTraining and tutorials\n\n### Learn to use policy validation\n\n\nIn this lab, you learn how to enforce policies on Terraform configurations.\n\n\n[Learn more](https://www.cloudskillsboost.google/focuses/33968?parent=catalog) \nCode sample \nCode Samples\n\n### Resource samples\n\n\nFind samples to build your infrastructure.\n\n\n[Open GitHub](/docs/terraform/samples) \nCode sample \nCode Samples\n\n### Blueprints\n\n\nFind deployable, reusable Terraform modules.\n\n\n[Open GitHub](/docs/terraform/blueprints/terraform-blueprints)\n\nRelated videos\n--------------"]]