[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-05。"],[[["\u003cp\u003eThis guide explains the process of uploading a Terraform configuration to a Cloud Storage bucket for use with Infra Manager.\u003c/p\u003e\n"],["\u003cp\u003eA storage bucket allows access control for your Terraform configuration, unlike a public Git repository, which may not offer this feature.\u003c/p\u003e\n"],["\u003cp\u003eYou can use any existing Cloud Storage bucket or create a new one, and enabling object versioning is recommended for tracking changes to your configuration.\u003c/p\u003e\n"],["\u003cp\u003eIf the storage bucket is in a different project than Infra Manager, you'll need to grant Infra Manager's service account read permission.\u003c/p\u003e\n"],["\u003cp\u003eOnce uploaded to a storage bucket you can deploy the Terraform configuration.\u003c/p\u003e\n"]]],[],null,["# Upload a Terraform configuration to a storage bucket\n\nThis page describes how to upload a Terraform configuration to a Cloud Storage\nbucket.\n\nA storage bucket allows you to control access to the configuration. If you are\nworking with a configuration that doesn't need access controls, you can use a\npublic Git repo.\n\nFor details about Terraform configurations and Infra Manager, see\n[Terraform and Infrastructure Manager](/infrastructure-manager/docs/terraform).\n\nBefore you begin\n----------------\n\n1. Ensure [Infra Manager is enabled](/infrastructure-manager/docs/enable-service).\n2. Identify the Terraform configuration to upload to a storage bucket.\n\nCreate a storage bucket\n-----------------------\n\nCreate or identify an existing Cloud Storage bucket to store the\nTerraform configuration. You can use any storage bucket, but it's common to use\na bucket in the same project where you will run Infra Manager.\n\nThe storage bucket can be in any project and location. It's common to\ncreate this bucket in the same project and location as where you run the\nInfra Manager service.\n\nTo create the storage bucket, see\n[Create buckets](/storage/docs/creating-buckets).\n\nGrant read permission for the bucket\n------------------------------------\n\nIf the storage bucket is in a different project from the project where you\nare running Infra Manager, then you need to ensure that\nInfra Manager's service account has read permission for the bucket.\nSee\n[Configure the service account](/infrastructure-manager/docs/configure-service-account)\nfor more details.\n\nIf the storage bucket is in the same project as Infra Manager, read\npermission to the bucket is already enabled.\n\nEnable Object Versioning for the bucket\n---------------------------------------\n\nWe recommend versioning the Terraform configuration so that you can track\nchanges and manage your infrastructure as code.\n\nTo version the configuration when it's stored in a Cloud Storage bucket, see\n[Use Object Versioning](/storage/docs/using-object-versioning).\n\nFor more details, see [Object Versioning](/storage/docs/object-versioning).\n\nUpload the Terraform configuration\n----------------------------------\n\nUpload the Terraform configuration to the storage bucket. To choose an upload\nmethod, see [Uploads and downloads](/storage/docs/uploads-downloads).\n\nWhat's next\n-----------\n\n- Deploy the Terraform configuration by [Creating a deployment](/infrastructure-manager/docs/deploy-resources).\n- Learn more about [Terraform and Google Cloud](/docs/terraform)."]]